Skip to content

Commit

Permalink
Add basic get_size_from_dict test.
Browse files Browse the repository at this point in the history
  • Loading branch information
atomatt committed Jul 5, 2010
1 parent e01f50d commit b6269f4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions formish/tests/unittests/test_fileresource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest
from formish import fileresource


class TestCase(unittest.TestCase):
def test_size_from_dict(self):
tests = [
({}, (None, None)),
({'size': '10x20'}, (10, 20)),
({'width': '10'}, (10, None)),
({'height': '20'}, (None, 20)),
]
for test, expected in tests:
result = fileresource.get_size_from_dict(test)
self.assertEquals(result, expected)


if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@
# -*- Entry points: -*-
""",
test_suite='formish.tests.unittests',
tests_require = ['BeautifulSoup'],
tests_require = ['BeautifulSoup', 'restish'],
)

0 comments on commit b6269f4

Please sign in to comment.