Test: unit test for handling of the factor of F/m
This test is supposed to cause a failure because of the wrong factor of F/m for SI1 and SI2 in commit 9db5dff7
This commit is contained in:
@@ -109,6 +109,15 @@ class UnitBasicCases(unittest.TestCase):
|
||||
v = FreeCAD.Units.parseQuantity(t[0]).getValueAs("ksi")
|
||||
self.assertAlmostEqual(1, v.Value, msg="Failed with \"{0}\" scheme: {1} != 1 (delta: {2})".format(schemes[i], v.Value, self.delta), delta=self.delta)
|
||||
|
||||
vacuum_permittivity = FreeCAD.Units.parseQuantity("1F/m")
|
||||
format = vacuum_permittivity.Format
|
||||
format["NumberFormat"] = "e" # scientific notation
|
||||
vacuum_permittivity.Format = format
|
||||
for i in range(num):
|
||||
t = FreeCAD.Units.schemaTranslate(vacuum_permittivity, i)
|
||||
v = FreeCAD.Units.parseQuantity(t[0]).getValueAs("F/m")
|
||||
self.assertAlmostEqual(1, v.Value, msg="Failed with \"{0}\" scheme: {1} != 1 (delta: {2})".format(schemes[i], v.Value, self.delta), delta=self.delta)
|
||||
|
||||
def testSchemeTranslation(self):
|
||||
quantities = []
|
||||
for i in dir(FreeCAD.Units):
|
||||
|
||||
Reference in New Issue
Block a user