示例#1
0
 def test_attribute_remove_raises(self):
     obj = application.TinmanAttributes()
     self.assertRaises(AttributeError, obj.remove, 'test_attr')
示例#2
0
 def test_attribute_delete(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'Foo'
     del obj.test_attr
     self.assertFalse('test_attr' in obj)
示例#3
0
 def test_attribute_remove(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'Foo'
     obj.remove('test_attr')
     self.assertFalse('test_attr' in obj)
示例#4
0
 def test_attribute_in_obj(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'First Value'
     self.assertTrue('test_attr' in obj)
示例#5
0
 def test_attribute_not_in_obj(self):
     obj = application.TinmanAttributes()
     self.assertFalse('test_attr' in obj)
示例#6
0
 def test_set_overwrite_attribute(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'First Value'
     value = 'Test Value'
     obj.test_attr = value
     self.assertEqual(obj.test_attr, value)
示例#7
0
 def test_set_attribute_matches(self):
     obj = application.TinmanAttributes()
     value = 'Test Value'
     obj.test_attr = value
     self.assertEqual(obj.test_attr, value)
示例#8
0
 def test_add_attribute_raises(self):
     obj = application.TinmanAttributes()
     value = 'Test Value'
     obj.add('test_attr', value)
     self.assertRaises(AttributeError, obj.add, 'test_attr', value)
示例#9
0
 def test_add_attribute_matches(self):
     obj = application.TinmanAttributes()
     value = 'Test Value'
     obj.add('test_attr', value)
     self.assertEqual(obj.test_attr, value)
示例#10
0
 def test_add_attribute_exists(self):
     obj = application.TinmanAttributes()
     obj.add('test_attr', 'test')
     self.assertTrue('test_attr' in obj)