def test_bad_link(self): response = { '_embedded': { 'activation': { '_links': { 'qrcode': { 'href': 'http://localhost:1/asdf' } } } } } qr_code = _get_qr_code_from_response(response) self.assertIsNone(qr_code)
def test_happy_path(self): imposter_url = self.setup_imposter('test_qr_code.json') response = { '_embedded': { 'activation': { '_links': { 'qrcode': { 'href': imposter_url } } } } } qr_code = _get_qr_code_from_response(response) self.assertIsNotNone(qr_code)
def test_bad_link(self): response = {"_embedded": {"activation": {"_links": {"qrcode": {"href": "http://localhost:1/asdf"}}}}} qr_code = _get_qr_code_from_response(response) self.assertIsNone(qr_code)
def test_missing_qr_code_link(self): response = {"_embedded": {"activation": {"_links": {"qrcode": {}}}}} qr_code = _get_qr_code_from_response(response) self.assertIsNone(qr_code)
def test_happy_path(self): imposter_url = self.setup_imposter("test_qr_code.json") response = {"_embedded": {"activation": {"_links": {"qrcode": {"href": imposter_url}}}}} qr_code = _get_qr_code_from_response(response) self.assertIsNotNone(qr_code)
def test_missing_qr_code_link(self): response = {'_embedded': {'activation': {'_links': {'qrcode': {}}}}} qr_code = _get_qr_code_from_response(response) self.assertIsNone(qr_code)