Example #1
0
 def testMillimeterConversion(self):
     got = document.valueToPixels('2mm')
     self.assertAlmostEqual(got, 5.67, places=2)
Example #2
0
 def testInchConversion(self):
     got = document.valueToPixels('2in')
     self.assertEqual(got, 144)
Example #3
0
 def testCentimeterConversion(self):
     got = document.valueToPixels('2cm')
     self.assertAlmostEqual(got, 56.7, places=1)
Example #4
0
 def testDefault(self):
     got = document.valueToPixels("12")
     self.assertEqual(got, 12)
Example #5
0
 def testPointConversion(self):
     got = document.valueToPixels('14pt')
     self.assertEqual(got, 14)
Example #6
0
 def testMillimeterConversion(self):
     got = document.valueToPixels('2mm')
     self.assertAlmostEqual(got, 5.67, places=2)
Example #7
0
 def testCentimeterConversion(self):
     got = document.valueToPixels('2cm')
     self.assertAlmostEqual(got, 56.7, places=1)
Example #8
0
 def testInchConversion(self):
     got = document.valueToPixels('2in')
     self.assertEqual(got, 144)
Example #9
0
 def testPointConversion(self):
     got = document.valueToPixels('14pt')
     self.assertEqual(got, 14)
Example #10
0
 def testDefault(self):
     got = document.valueToPixels("12")
     self.assertEqual(got, 12)