Skip to content

Commit c7431f4

Browse files
committed
Add some basic testing for NovellBugzilla
1 parent 4021245 commit c7431f4

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

bugzilla/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def getBugzillaClassForURL(url):
3232
bzversion = ''
3333
c = None
3434

35+
if url.count("novell.com"):
36+
logging.debug("Detected Novell bugzilla based on novell.com")
37+
return NovellBugzilla
38+
3539
# Check for a Red Hat extension
3640
try:
3741
log.debug("Checking for Red Hat Bugzilla extension")
@@ -44,7 +48,7 @@ def getBugzillaClassForURL(url):
4448

4549
# Try to get the bugzilla version string
4650
try:
47-
log.debug("Checking return value of Buzilla.version()")
51+
log.debug("Checking return value of Bugzilla.version()")
4852
r = s.Bugzilla.version()
4953
bzversion = r['version']
5054
except xmlrpclib.Fault:

bugzilla/nvlbugzilla.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import urllib2
1818
import urlparse
1919

20-
from bugzilla import BugzillaError, Bugzilla32, log
20+
from bugzilla import BugzillaError, Bugzilla34, log
2121

2222

23-
class NovellBugzilla(Bugzilla32):
23+
class NovellBugzilla(Bugzilla34):
2424
'''
2525
bugzilla.novell.com is a standard bugzilla 3.2 with some extensions, but
2626
it uses an proprietary and non-standard IChain login system. This class

tests/ro_functional.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,27 @@ class BZ42(BaseTest):
164164
"3450 [email protected] Error")
165165

166166

167+
class NovellBugzilla(BaseTest):
168+
url = "https://bugzilla.novell.com/xmlrpc.cgi"
169+
bzclass = bugzilla.NovellBugzilla
170+
171+
test0 = BaseTest._testBZClass
172+
173+
test1 = lambda s: BaseTest._testQuery(s,
174+
"--product \"openSUSE 11.0\" --component Basesystem",
175+
15, "83209")
176+
177+
def testLoginFail(self):
178+
# Currently gives a 404 error, so something is busted.
179+
# However if I drop all the custom stuff plain ol BZ login works
180+
bz = self.bzclass(url=self.url, cookiefile=None)
181+
try:
182+
bz.login("foouser", "barpassword")
183+
raise AssertionError("Expected novell login fail")
184+
except Exception, e:
185+
self.assertTrue("404" in str(e))
186+
187+
167188
class RHTest(BaseTest):
168189
url = "https://bugzilla.redhat.com/xmlrpc.cgi"
169190
bzclass = bugzilla.RHBugzilla

0 commit comments

Comments
 (0)