Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test failure #246

Open
tisnik opened this issue Mar 1, 2019 · 0 comments
Open

Unit test failure #246

tisnik opened this issue Mar 1, 2019 · 0 comments
Labels

Comments

@tisnik
Copy link
Member

tisnik commented Mar 1, 2019

=================================== FAILURES ===================================
__________________________ test_ingest_to_graph_valid __________________________

client = <FlaskClient <Flask 'data_importer_app'>>

    def test_ingest_to_graph_valid(client):
        """Add test for ingest to graph API when some key is missing."""
        input_data = [
            {
                "ecosystem": "maven",
                "name": "commons-collections:commons-collections",
                "source_repo": "redhat_maven"
            }
        ]
        url = url_for('api_v1.ingest_to_graph')
        response = client.post(url,
                               data=json.dumps(input_data),
                               headers={'Content-Type': 'application/json'})
        # we expect that the HTTP code will be 400/Bad Request
        assert response.status_code == 400
        data = json.loads(response.get_data().decode('utf-8'))
        epv_keys = input_data[0].keys()
>       assert data['message'] == 'Invalid keys found in input: ' + ','.join(epv_keys)
E       AssertionError: assert 'Invalid keys...m,source_repo' == 'Invalid keys ...cosystem,name'
E         - Invalid keys found in input: name,ecosystem,source_repo
E         ?                              ^^^            ^^^^^ -----
E         + Invalid keys found in input: source_repo,ecosystem,name
E         ?                              ^^^^^ +++++           ^^^

test/test_rest_api.py:122: AssertionError
@tisnik tisnik added the bug label Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant