Skip to content

Commit

Permalink
Add test for very simple search
Browse files Browse the repository at this point in the history
  • Loading branch information
bibliotechy committed Sep 24, 2014
1 parent c0cf2cf commit 6041b2b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_invalid_api_key(self):
with self.assertRaises(ValueError):
dpla = DPLA("shortstring")


class DPyLARequest(unittest.TestCase):

def setUp(self):
Expand Down Expand Up @@ -68,6 +67,14 @@ def test_build_url(self):
expected += "sourceResource.title=Chicago&sourceResource.subject=Food&api_key="
self.assertEqual(url, expected, "Three parameter item search url is constructed correctly")

class DPyLASearch(unittest.TestCase):

def setUp(self):
self.dpla = DPLA("9da474273d98c8dc3dc567939e89f9f8")

def test_search_simple(self):
results = self.dpla.search("chickens")
self.assertGreaterEqual(results.count, 0, "Results count sould contain at least one result")

if __name__ == '__main__':
unittest.main()
unittest.main()

0 comments on commit 6041b2b

Please sign in to comment.