Skip to content

Commit 89b41cd

Browse files
committed
tests: More usage of --redhat-url
1 parent fd269b4 commit 89b41cd

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

tests/ro_functional.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ def clicomm(self, argstr, expectexc=False, bz=None):
3838
def _testBZVersion(self):
3939
bz = Bugzilla(self.url, use_creds=False)
4040
self.assertEquals(bz.__class__, self.bzclass)
41-
self.assertEquals(bz.bz_ver_major, self.bzversion[0])
42-
self.assertEquals(bz.bz_ver_minor, self.bzversion[1])
41+
if tests.REDHAT_URL:
42+
print("BZ version=%s.%s" % (bz.bz_ver_major, bz.bz_ver_minor))
43+
else:
44+
self.assertEquals(bz.bz_ver_major, self.bzversion[0])
45+
self.assertEquals(bz.bz_ver_minor, self.bzversion[1])
4346

4447
# Since we are running these tests against bugzilla instances in
4548
# the wild, we can't depend on certain data like product lists
@@ -112,7 +115,12 @@ def _testQueryFormat(self, args, expectstr):
112115
out = self.clicomm("query %s" % args)
113116
self.assertTrue(expectstr in out)
114117

115-
def _testQueryURL(self, url, count, expectstr):
118+
def _testQueryURL(self, querystr, count, expectstr):
119+
url = self.url
120+
if "/xmlrpc.cgi" in self.url:
121+
url = url.replace("/xmlrpc.cgi", querystr)
122+
else:
123+
url += querystr
116124
out = self.clicomm("query --from-url \"%s\"" % url)
117125
self.assertEqual(len(out.splitlines()), count)
118126
self.assertTrue(expectstr in out)
@@ -222,7 +230,7 @@ class RHTest(BaseTest):
222230
"sum=%{summary}\"",
223231
"id=307471 sw= bzcl34nup needinfo= ")
224232
test11 = lambda s: BaseTest._testQueryURL(s,
225-
"https://bugzilla.redhat.com/buglist.cgi?f1=creation_ts"
233+
"/buglist.cgi?f1=creation_ts"
226234
"&list_id=973582&o1=greaterthaneq&classification=Fedora&"
227235
"o2=lessthaneq&query_format=advanced&f2=creation_ts"
228236
"&v1=2010-01-01&component=python-bugzilla&v2=2011-01-01"

tests/rw_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ def compare(data, newid):
824824
self.assertTrue("Sorry, you aren't a member" in str(e))
825825

826826
def test12SetCookie(self):
827-
bz = self.bzclass("partner-bugzilla.redhat.com",
827+
bz = self.bzclass(self.url,
828828
cookiefile=-1, tokenfile=None)
829829

830830
try:

0 commit comments

Comments
 (0)