def test_invalid_arg_number(self): with self.assertRaises(TypeError): BorderSpacing(1, 2, 3)
def test_valid_2_arg_px(self): border_spacing = BorderSpacing(1 * px, 2 * px) self.assertEqual(border_spacing.horizontal, 1 * px) self.assertEqual(border_spacing.vertical, 2 * px) self.assertEqual(str(border_spacing), '1px 2px') self.assertEqual(repr(border_spacing), 'BorderSpacing(1px, 2px)')
def test_valid_2_arg_str(self): border_spacing = BorderSpacing('1', '2') self.assertEqual(border_spacing.horizontal, '1') self.assertEqual(border_spacing.vertical, '2') self.assertEqual(str(border_spacing), '1 2') self.assertEqual(repr(border_spacing), "BorderSpacing('1', '2')")
def test_valid_2_arg_int(self): border_spacing = BorderSpacing(1, 2) self.assertEqual(border_spacing.horizontal, 1) self.assertEqual(border_spacing.vertical, 2) self.assertEqual(str(border_spacing), '1 2') self.assertEqual(repr(border_spacing), 'BorderSpacing(1, 2)')
def test_valid_1_arg_int(self): border_spacing = BorderSpacing(1) self.assertEqual(border_spacing.horizontal, 1) self.assertEqual(border_spacing.vertical, 1) self.assertEqual(str(border_spacing), '1') self.assertEqual(repr(border_spacing), "BorderSpacing(1)")