예제 #1
0
파일: tests.py 프로젝트: zekroTJA/giphypop
 def test_hasattr(self):
     foo = AttrDict(bar='baz')
     assert hasattr(foo, 'bar')
     assert not hasattr(foo, 'baz')
예제 #2
0
파일: tests.py 프로젝트: zekroTJA/giphypop
 def test_set_attribute_proxies_key(self):
     foo = AttrDict()
     foo.bar = 'baz'
     assert foo['bar'] == 'baz'
예제 #3
0
파일: tests.py 프로젝트: zekroTJA/giphypop
 def test_get_attribte(self):
     foo = AttrDict(bar='baz')
     assert foo.bar == 'baz'
예제 #4
0
파일: tests.py 프로젝트: zekroTJA/giphypop
 def test_set_attribute(self):
     foo = AttrDict()
     foo.bar = 'baz'
     assert foo.bar == 'baz'
예제 #5
0
파일: tests.py 프로젝트: zekroTJA/giphypop
 def test_get_attribute_raises(self):
     foo = AttrDict()
     self.assertRaises(AttributeError, lambda: foo.bar)