1 2from PyObjCTools.TestSupport import * 3from InterfaceBuilderKit import * 4 5class TestIBGeometry (TestCase): 6 def testConstants(self): 7 self.assertEqual(IBNoDirection, 0) 8 self.assertEqual(IBMinXDirection, 1) 9 self.assertEqual(IBMaxXDirection, 2) 10 self.assertEqual(IBMinYDirection, 4) 11 self.assertEqual(IBMaxYDirection, 8) 12 self.assertEqual(IBMinXMinYDirection, (IBMinXDirection | IBMinYDirection)) 13 self.assertEqual(IBMinXMaxYDirection, (IBMinXDirection | IBMaxYDirection)) 14 self.assertEqual(IBMaxXMinYDirection, (IBMaxXDirection | IBMinYDirection)) 15 self.assertEqual(IBMaxXMaxYDirection, (IBMaxXDirection | IBMaxYDirection)) 16 17 def testStructs(self): 18 o = IBInset() 19 self.assertHasAttr(o, 'left') 20 self.assertHasAttr(o, 'top') 21 self.assertHasAttr(o, 'right') 22 self.assertHasAttr(o, 'bottom') 23 self.assertIsInstance(o.left, float) 24 self.assertIsInstance(o.top, float) 25 self.assertIsInstance(o.right, float) 26 self.assertIsInstance(o.bottom, float) 27 28if __name__ == "__main__": 29 main() 30