class AvailabilityCheckerTest(TestCase): """ Checks JosiahAvailabilityChecker() """ def setUp(self): self.checker = JosiahAvailabilityChecker() def test_check_josiah_availability__no_isbn(self): """ Should return holdings for both isbn check and oclc check. """ isbn = '' oclc_num = '673595' self.assertEqual( [ {'status': 'AVAILABLE', 'callnumber': 'CT275.P648 A33 c.3', 'location': 'ROCK'}, {'status': 'AVAILABLE', 'callnumber': 'CT275.P648 A33 c.4', 'location': 'ROCK'} ], self.checker.check_josiah_availability( isbn, oclc_num ) ) def test_check_josiah_availability__no_oclcnum(self): """ Should return holdings for both isbn check and oclc check. """ isbn = '9788934900894' oclc_num = '' self.assertEqual( [], self.checker.check_josiah_availability( isbn, oclc_num ) ) def test_check_josiah_availability__holdings_returned(self): """ Should return holdings for both isbn check and oclc check. """ isbn = '9780688002305' oclc_num = '673595' self.assertEqual( [ {'status': 'AVAILABLE', 'callnumber': 'CT275.P648 A33 c.3', 'location': 'ROCK'}, {'status': 'AVAILABLE', 'callnumber': 'CT275.P648 A33 c.4', 'location': 'ROCK'} ], self.checker.check_josiah_availability( isbn, oclc_num ) )
def setUp(self): self.checker = JosiahAvailabilityChecker()