def testMillimeterConversion(self): got = document.valueToPixels('2mm') self.assertAlmostEqual(got, 5.67, places=2)
def testInchConversion(self): got = document.valueToPixels('2in') self.assertEqual(got, 144)
def testCentimeterConversion(self): got = document.valueToPixels('2cm') self.assertAlmostEqual(got, 56.7, places=1)
def testDefault(self): got = document.valueToPixels("12") self.assertEqual(got, 12)
def testPointConversion(self): got = document.valueToPixels('14pt') self.assertEqual(got, 14)