Skip to content

Commit 4c28bbf

Browse files
committed
tests: Extend bugzillarc test for api_key
1 parent 82f8069 commit 4c28bbf

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/misc.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def testCookies(self):
7575
tests.make_bz("3.0.0", cookiefile=cookiesmoz)
7676

7777
def test_readconfig(self):
78+
# Testing for bugzillarc handling
7879
bzapi = tests.make_bz("4.4.0", rhbz=True)
7980
bzapi.url = "foo.example.com"
8081
temp = tempfile.NamedTemporaryFile(mode="w")
@@ -89,23 +90,29 @@ def test_readconfig(self):
8990
bzapi.readconfig(temp.name)
9091
self.assertEquals(bzapi.user, "test1")
9192
self.assertEquals(bzapi.password, "test2")
93+
self.assertEquals(bzapi.api_key, None)
9294

9395
content = """
9496
[foo.example.com]
9597
user=test3
96-
password=test4"""
98+
password=test4
99+
api_key=123abc
100+
"""
97101
temp.write(content)
98102
temp.flush()
99103
bzapi.readconfig(temp.name)
100104
self.assertEquals(bzapi.user, "test3")
101105
self.assertEquals(bzapi.password, "test4")
106+
self.assertEquals(bzapi.api_key, "123abc")
102107

103108
bzapi.url = "bugzilla.redhat.com"
104109
bzapi.user = None
105110
bzapi.password = None
111+
bzapi.api_key = None
106112
bzapi.readconfig(temp.name)
107113
self.assertEquals(bzapi.user, None)
108114
self.assertEquals(bzapi.password, None)
115+
self.assertEquals(bzapi.api_key, None)
109116

110117

111118
def testPostTranslation(self):

0 commit comments

Comments
 (0)