Skip to content

Commit

Permalink
fixup! Increase tests coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mvalik committed Oct 12, 2023
1 parent 4ca1220 commit 93edd1e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_api_v10.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .utils import create_waiver
from waiverdb import __version__
from waiverdb.models import Waiver
from waiverdb.api_v1 import get_resultsdb_result


@pytest.fixture
Expand All @@ -37,6 +38,25 @@ def mocked_resultsdb():
yield mocked_resultsdb


def test_get_resultsdb_result():
test_id = 10
with patch('requests.Session.request') as req:
resp = Mock()
resp.json.return_value = {
'data': {
'type': ['koji_build'],
'item': ['somebuild'],
'scenario': ['somescenario'],
},
'testcase': {'name': 'sometest'}
}
assert get_resultsdb_result(test_id) == resp.json.return_value
req.assert_called_with(
'GET', f'TEST/results/{test_id}', headers={'Content-Type': 'application/json'},
timeout=60
)


def test_create_waiver(mocked_user, client, session):
data = {
'subject_type': 'koji_build',
Expand Down

0 comments on commit 93edd1e

Please sign in to comment.