def static_files_are_served_correctly():
    file_names = ['logo.png', 'sprite.png', 'glimpse.js']

    for file_name in file_names:
        request = requests.get(resource_url(file_name))
        assert_equal(200, request.status_code)

        file_path = dirname(__file__) + '/../static_files/' + file_name
        with open(file_path, 'rb') as static_file:
            assert_equal(static_file.read(), request.content)
def correct_metadata_is_returned():
    metadata = {
        'version': '0.0.1',
        'plugins': {},
        'resources': resource_configuration.get_resource_metadata()
    }
    expected = 'glimpse.data.initMetadata({0});'.format(json.dumps(metadata))

    url = resource_url('metadata?callback=glimpse.data.initMetadata')
    request = requests.get(url)

    assert_equal(expected, request.text)
def metadata_endpoint_exists():
    request = requests.get(resource_url('metadata'))
    assert_equal(200, request.status_code)
def _send_request_to_requestresource():
    request = requests.get(application_url())
    assert_in('x-glimpse-requestid', request.headers)
    request_id = request.headers['x-glimpse-requestid']

    return requests.get(resource_url('request/{}'.format(request_id)))