def test_read_only_init01(self): width = 0 height = 0 rect = DOMRectReadOnly() self.assertTrue(rect.isempty()) self.assertFalse(rect.isvalid()) self.assertIsNone(rect.x) self.assertIsNone(rect.left) self.assertIsNone(rect.y) self.assertIsNone(rect.top) self.assertIsNone(rect.right) self.assertIsNone(rect.bottom) self.assertEqual(width, rect.width) self.assertEqual(height, rect.height)
def test_read_only_init03(self): x = -200 y = -100 width = 600 height = 300 rect = DOMRectReadOnly(x, y, width, height) self.assertFalse(rect.isempty()) self.assertTrue(rect.isvalid()) self.assertEqual(x, rect.x) self.assertEqual(x, rect.left) self.assertEqual(y, rect.y) self.assertEqual(y, rect.top) self.assertEqual(x + width, rect.right) self.assertEqual(y + height, rect.bottom) self.assertEqual(width, rect.width) self.assertEqual(height, rect.height)