def test_getattr__setattr(self):
     x = AttributeDict({'foo': 'bar'})
     assert x['foo'] == 'bar'
     with pytest.raises(AttributeError):
         x.bar
     x.bar = 'foo'
     assert x['bar'] == 'foo'
Beispiel #2
0
 def test_getattr__setattr(self):
     x = AttributeDict({'foo': 'bar'})
     self.assertEqual(x['foo'], 'bar')
     with self.assertRaises(AttributeError):
         x.bar
     x.bar = 'foo'
     self.assertEqual(x['bar'], 'foo')
 def test_getattr__setattr(self):
     x = AttributeDict({'foo': 'bar'})
     assert x['foo'] == 'bar'
     with pytest.raises(AttributeError):
         x.bar
     x.bar = 'foo'
     assert x['bar'] == 'foo'
 def test_getattr__setattr(self):
     x = AttributeDict({'foo': 'bar'})
     self.assertEqual(x['foo'], 'bar')
     with self.assertRaises(AttributeError):
         x.bar
     x.bar = 'foo'
     self.assertEqual(x['bar'], 'foo')