Example #1
0
 def test_attribute_remove_raises(self):
     obj = application.TinmanAttributes()
     self.assertRaises(AttributeError, obj.remove, 'test_attr')
Example #2
0
 def test_attribute_delete(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'Foo'
     del obj.test_attr
     self.assertFalse('test_attr' in obj)
Example #3
0
 def test_attribute_remove(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'Foo'
     obj.remove('test_attr')
     self.assertFalse('test_attr' in obj)
Example #4
0
 def test_attribute_in_obj(self):
     obj = application.TinmanAttributes()
     obj.test_attr = 'First Value'
     self.assertTrue('test_attr' in obj)
Example #5
0
 def test_attribute_not_in_obj(self):
     obj = application.TinmanAttributes()
     self.assertFalse('test_attr' in obj)
Example #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)
Example #7
0
 def test_set_attribute_matches(self):
     obj = application.TinmanAttributes()
     value = 'Test Value'
     obj.test_attr = value
     self.assertEqual(obj.test_attr, value)
Example #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)
Example #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)
Example #10
0
 def test_add_attribute_exists(self):
     obj = application.TinmanAttributes()
     obj.add('test_attr', 'test')
     self.assertTrue('test_attr' in obj)