elmcitylabs/objectifier — pull request #2 by msabramo (2012-08-25 01:03:16+00:00)
Title: Add tests

I started adding some tests. One of the tests I wrote succeeds and one fails. This might be a bug in objectifier or it might be misunderstanding how it's supposed to work.

```
marca@scml-marca:~/dev/git-repos/objectifier$ python setup.py test
running test
running egg_info
writing objectifier.egg-info/PKG-INFO
writing top-level names to objectifier.egg-info/top_level.txt
writing dependency_links to objectifier.egg-info/dependency_links.txt
reading manifest file 'objectifier.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'objectifier.egg-info/SOURCES.txt'
running build_ext
test_that_fails (objectifier.tests.BasicTests) ... obj =
obj.People =
obj.People.Person =
obj.People.Person.Age = u'Name'
ERROR
test_that_succeeds (objectifier.tests.BasicTests) ... ok

======================================================================
ERROR: test_that_fails (objectifier.tests.BasicTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/marca/dev/git-repos/objectifier/objectifier/tests.py", line 53, in test_that_fails
print("obj.People.Person[0] = %r" % obj.People.Person[0])
File "/Users/marca/dev/git-repos/objectifier/objectifier/objectifier.py", line 84, in __getitem__
return Objectifier.objectify_if_needed(self.response_data[k])
KeyError: 0

----------------------------------------------------------------------
Ran 2 tests in 0.001s

FAILED (errors=1)
```