Exemple #1
0
 def test_get_app_bad_id(self):
     """ Negative test using a random app """
     response = apps.get_app(
         environment.ATHERA_API_TEST_BASE_URL,
         environment.ATHERA_API_TEST_GROUP_ID,
         self.token,
         str(uuid.uuid4()),
     )
     self.assertEqual(response.status_code, codes.not_found)
Exemple #2
0
 def test_get_app(self):
     """ Positive test """
     response = apps.get_app(
         environment.ATHERA_API_TEST_BASE_URL,
         environment.ATHERA_API_TEST_GROUP_ID,
         environment.ATHERA_API_TEST_TOKEN,
         environment.ATHERA_API_TEST_INTERACTIVE_APP_ID,
     )
     self.assertEqual(response.status_code, codes.ok)
     app = response.json()
     self.assertIn("id", app)
     self.assertEqual(environment.ATHERA_API_TEST_INTERACTIVE_APP_ID, app['id'])
Exemple #3
0
def validate_app(logger, base_url, group_id, token, app_id):
    """
    Perform a lookup of the supplied app_id. 

    Return None if not found
    """
    app_response = apps.get_app(base_url, group_id, token, app_id)
    if not app_response:
        return None

    app_dict = common.convert_response(app_response)
    if not app_dict:
        return None

    logger.info("App: {}".format(app_dict))
    return app_dict