Browse files

Add basic get_size_from_dict test.

  • Loading branch information...
1 parent e01f50d commit b6269f41f70999c406ef828af751e33ac705c0f5 @emgee emgee committed Jul 5, 2010
Showing with 20 additions and 1 deletion.
  1. +19 −0 formish/tests/unittests/test_fileresource.py
  2. +1 −1 setup.py
View
19 formish/tests/unittests/test_fileresource.py
@@ -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()
View
2 setup.py
@@ -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.