Skip to content

Commit

Permalink
test: add test for default route
Browse files Browse the repository at this point in the history
Signed-off-by: afrid18 <afridhussain.d@gmail.com>
  • Loading branch information
afrid18 committed Apr 7, 2024
1 parent c5aee5c commit 7fb0fe6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,18 @@ def test_suite_run_success(m_get_run_details, m_get_username, m_logs_run):
assert response.json() == {"run": {"id": "7451978", "user": "user1"}}


# make_run_name

# test suite with default args
@patch("teuthology_api.services.suite.logs_run")
@patch("teuthology_api.routes.suite.get_username")
@patch("teuthology_api.services.suite.get_run_details")
def test_suite_run_default_success(m_get_run_details, m_get_username, m_logs_run):
m_get_username.return_value = "user1"
m_get_run_details.return_value = {"id": "7451978", "user": "user1"}
response = client.post("/suite/default", data=json.dumps(mock_suite_args))
assert response.status_code == 200
assert response.json() == {"run": {"id": "7451978", "user": "user1"}}

# make_run_name
def test_make_run_name():
m_run_dic = {
"user": "testuser",
Expand Down

0 comments on commit 7fb0fe6

Please sign in to comment.