1212from __future__ import print_function
1313
1414import atexit
15- import logging
1615import os
1716import shutil
1817import sys
@@ -64,11 +63,8 @@ class MiscAPI(unittest.TestCase):
6463 Test miscellaneous API bits
6564 """
6665 def testUserAgent (self ):
67- b3 = bugzilla .Bugzilla3 (url = None , cookiefile = None , tokenfile = None )
68- rhbz = bugzilla .RHBugzilla (url = None , cookiefile = None , tokenfile = None )
69-
70- self .assertTrue (b3 .user_agent .endswith ("Bugzilla3" ))
71- self .assertTrue (rhbz .user_agent .endswith ("RHBugzilla" ))
66+ b3 = tests .make_bz ("3.0.0" )
67+ self .assertTrue ("python-bugzilla" in b3 .user_agent )
7268
7369 def testCookies (self ):
7470 cookiesbad = os .path .join (os .getcwd (), "tests/data/cookies-bad.txt" )
@@ -83,7 +79,7 @@ def cleanup():
8379 shutil .copy (cookieslwp , cookiesnew )
8480
8581 # Mozilla should be converted inplace to LWP
86- bugzilla . Bugzilla3 ( url = None , cookiefile = cookiesnew )
82+ tests . make_bz ( "3.0.0" , cookiefile = cookiesnew )
8783
8884 def strip_comments (content ):
8985 return [l for l in content .split ("\n " ) if not l .startswith ("#" )]
@@ -93,18 +89,18 @@ def strip_comments(content):
9389
9490 # Make sure bad cookies raise an error
9591 try :
96- bugzilla . Bugzilla3 ( url = None , cookiefile = cookiesbad )
92+ tests . make_bz ( "3.0.0" , cookiefile = cookiesbad )
9793 raise AssertionError ("Expected BugzillaError from parsing %s" %
9894 os .path .basename (cookiesbad ))
9995 except bugzilla .BugzillaError :
10096 # Expected result
10197 pass
10298
10399 # Mozilla should 'just work'
104- bugzilla . Bugzilla3 ( url = None , cookiefile = cookiesmoz )
100+ tests . make_bz ( "3.0.0" , cookiefile = cookiesmoz )
105101
106102 def test_readconfig (self ):
107- bzapi = bugzilla . RHBugzilla ( url = None )
103+ bzapi = tests . make_bz ( "4.4.0" , rhbz = True )
108104 bzapi .url = "foo.example.com"
109105 temp = tempfile .NamedTemporaryFile (mode = "w" )
110106
@@ -147,8 +143,8 @@ def _testPostCompare(bz, indict, outexpect):
147143 bz .post_translation ({}, outdict )
148144 self .assertTrue (outdict == outexpect )
149145
150- bug3 = bugzilla . Bugzilla3 ( url = None , cookiefile = None , tokenfile = None )
151- rhbz = bugzilla . RHBugzilla ( url = None , cookiefile = None , tokenfile = None )
146+ bug3 = tests . make_bz ( "3.4.0" )
147+ rhbz = tests . make_bz ( "4.4.0" , rhbz = True )
152148
153149 test1 = {
154150 "component" : ["comp1" ],
0 commit comments