def test_create_new_with_None(self): target = Data(create_new=None) target.B = 10 self.assertIsNone(target.A) self.assertEqual(target.B, 10)
def test_create_new_with_string(self): target = Data(create_new=str) target.B = 10 self.assertEqual(target.A, '') self.assertEqual(target.B, 10)
def test_contains(self): target = Data() target.B = 10 self.assertNotIn('A', target) self.assertIn('B', target)
def test_can_set_simple_attributes(self): target = Data() target.A = 1 target.B = 'foo' self.assertEqual(target.DATA, {'A': 1, 'B': 'foo'})