Example #1
0
 def test_ReturnSearchTypeStructureForBook(self):
     result = providers.ReturnSearchTypeStructure(
         'api_key', {
             "bookid": 'bookid',
             "bookName": 'bookname',
             "authorName": 'author',
             "searchterm": 'term'
         }, 'book')
     self.assertEquals(
         {
             'author': 'author',
             'apikey': 'api_key',
             't': 'book',
             'cat': 7020,
             'title': 'bookname'
         }, result)
Example #2
0
 def test_ReturnSearchTypeStructureForGeneral(self):
     result = providers.ReturnSearchTypeStructure(
         'api_key', {
             "bookid": 'bookid',
             "bookName": 'bookname',
             "authorName": 'author',
             "searchterm": 'term'
         }, None)
     self.assertEquals(
         {
             'q': 'term',
             'apikey': 'api_key',
             't': 'search',
             'extended': 1,
             'cat': 7020
         }, result)