tests/imei_api.py
def check_in_registration_list_helper(imei_list, expect_to_find_in_reg, api_version, flask_app):
    """Helper function to make a request and check in_registration_list value in the response."""
    if api_version == 'v1':
        for i in imei_list:
            rv = flask_app.get(url_for('{0}.imei_api'.format(api_version), imei=i))
            assert rv.status_code == 200
            data = json.loads(rv.data.decode('utf-8'))
            assert data['realtime_checks']['in_registration_list'] is expect_to_find_in_reg
    else:
        assert False
Helper function to make a request and check in_registration_list value in the response.
Helper function to make a request and check in_registration_list value in the response.
Helper function to make a request and check in_registration_list value in the response .
def check_in_registration_list_helper(imei_list, expect_to_find_in_reg, api_version, flask_app):
    if api_version == 'v1':
        for i in imei_list:
            rv = flask_app.get(url_for('{0}.imei_api'.format(api_version), imei=i))
            assert rv.status_code == 200
            data = json.loads(rv.data.decode('utf-8'))
            assert data['realtime_checks']['in_registration_list'] is expect_to_find_in_reg
    else:
        assert False
def check_in_registration_list_helper ( imei_list , expect_to_find_in_reg , api_version , flask_app ) : if api_version == 'v1' : for i in imei_list : rv = flask_app . get ( url_for ( '{0}.imei_api' . format ( api_version ) , imei = i ) ) assert rv . status_code == 200 data = json . loads ( rv . data . decode ( 'utf-8' ) ) assert data [ 'realtime_checks' ] [ 'in_registration_list' ] is expect_to_find_in_reg else : assert False
Helper function to make a request and check in_registration_list value in the response.
Helper function to make a request and check in_registration_list value in the response .
"""Helper function to make a request and check in_registration_list value in the response."""
imei_list
expect_to_find_in_reg
api_version
flask_app