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)
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)