Skip to content

Commit 5ab1123

Browse files
committed
Bugzilla: Add some tests for regressed coverage pieces
Signed-off-by: Cole Robinson <crobinso@redhat.com>
1 parent f5079ac commit 5ab1123

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(['123456'], ['CVE-1234-FAKE'], {'permissive': 1})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{'login': None, 'password': None}

tests/test_api_bug.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ def test_api_getbugs():
9292
assert bug.alias == ["CVE-1234-5678"]
9393
assert bug.autorefresh is True
9494

95+
fakebz = tests.mockbackend.make_bz(
96+
bug_get_args="data/mockargs/test_api_getbugs2.txt",
97+
bug_get_return={"bugs": [{}, {}]})
98+
assert fakebz.getbugs(["123456", "CVE-1234-FAKE"]) == []
99+
95100

96101
def test_bug_getattr():
97102
fakebz = tests.mockbackend.make_bz(

tests/test_api_misc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ def test_api_login():
198198
bz.connect("https:///fake/bugzilla.redhat.com")
199199
bz.connect()
200200

201+
# Test auto login if user/password is set
202+
bz = tests.mockbackend.make_bz(
203+
bz_kwargs={"user": "FOO", "password": "BAR"},
204+
user_login_args="data/mockargs/test_api_login2.txt",
205+
user_login_return={})
206+
201207

202208
def test_interactive_login(capsys, monkeypatch):
203209
bz = tests.mockbackend.make_bz(

0 commit comments

Comments
 (0)