Skip to content

Commit

Permalink
Merge branch 'fix-test-params' of 'https://github.com/jjmerchante/gri…
Browse files Browse the repository at this point in the history
…moirelab-elk'

Merges #1125
Closes #1125
  • Loading branch information
sduenas authored Oct 19, 2023
2 parents cfe6ce1 + 83becb7 commit fead903
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_elk.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ def test_anonymize_params(self):
def test_feed_backend_wrong_params(self):
"""Test feed_backend with wrong parameters."""

# Jira has not --api-token argument
backend_params = ['https://jira.example.org', '--api-token', 'mypersonaltoken']
# Jira has not --foo-bar argument
backend_params = ['https://jira.example.org', '--foo-bar']
projects_json_repo = 'https://jira.example.org'
expected_msg = "Error feeding raw. Wrong jira arguments: ('https://jira.example.org', " \
"'--api-token', 'xxxxx')"
expected_msg = "Error feeding raw. Wrong jira arguments: ('https://jira.example.org', '--foo-bar')"
error_msg = feed_backend(self.es_con, False, False, "jira", backend_params,
"jira_raw", "jira_enriched", projects_json_repo=projects_json_repo)
self.assertEqual(error_msg, expected_msg)
Expand All @@ -76,10 +75,10 @@ def test_feed_backend_wrong_params(self):
def test_enrich_backend_wrong_params(self):
"""Test enrich_backend with wrong parameters."""

# Jira has not --api-token argument
backend_params = ['https://jira.example.org', '--api-token', 'mypersonaltoken']
# Jira has not --foo-bar argument
backend_params = ['https://jira.example.org', '--foo-bar']
projects_json_repo = 'https://jira.example.org'
expected_msg = "Error enriching raw. Wrong jira arguments: ('https://jira.example.org', '--api-token', 'xxxxx')"
expected_msg = "Error enriching raw. Wrong jira arguments: ('https://jira.example.org', '--foo-bar')"
with self.assertLogs(logger, level='ERROR') as cm:
enrich_backend(self.es_con, False, "jira", backend_params, "jira",
"jira_raw", "jira_enriched", projects_json_repo=projects_json_repo)
Expand Down

0 comments on commit fead903

Please sign in to comment.