def test_calls_overview_system_error_throws(self): session = LeapSession() with (open(sampledatadir + "overview_page_invalid_account.html", "r")) as f: page = f.read() with self.assertRaises(Exception) as context: session._LeapSession__handle_card_overview_response(page) expected = Exception( u"System Error", u"The application experienced unexpected problems completing your request (Code E002). We're sorry for the inconvenience. Please try again later." ) self.assertEqual(str(context.exception), str(expected))
def test_calls_overview_returns_expected(self): session = LeapSession() with (open(sampledatadir + "overview_page.html", "r")) as f: page = f.read() result = session._LeapSession__handle_card_overview_response(page) expected = CardOverview(u"1000000000", u"User's Card", 25.02, u"Adult", u"Unblocked", u"Unblocked", u"Not Enabled", u"02/04/2012 12:00:00 AM", u"09/12/2023 12:00:00 AM") self.assertEqual(result.__dict__, expected.__dict__)