def test_get_bug(self): httpretty.register_uri( httpretty.POST, 'https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=81873', body=open(os.path.join(TEST_DATA, 'bug-81873.xml')).read(), ) bugzilla = Bugzilla('', '') bug = bugzilla.get_bug(81873) self.assertEqual(bug.bug_id, '81873') self.assertTrue(bug.has_nonempty('classification'))
def test_get_bug(self): ''' Test getting existing bug. ''' httpretty.register_uri( httpretty.POST, 'https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=81873', body=open(os.path.join(TEST_DATA, 'bug-81873.xml')).read(), ) bugzilla = Bugzilla('', '') bug = bugzilla.get_bug(81873) self.assertEqual(bug.bug_id, '81873') self.assertTrue(bug.has_nonempty('classification'))
def test_get_bug(self): """ Test getting existing bug. """ httpretty.register_uri( httpretty.POST, "https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=81873", body=open(os.path.join(TEST_DATA, "bug-81873.xml")).read(), ) bugzilla = Bugzilla("", "") bug = bugzilla.get_bug(81873) self.assertEqual(bug.bug_id, "81873") self.assertTrue(bug.has_nonempty("classification"))
def test_get_multiple_flag_bug(self): ''' Test that multiple flags can be handled as well. ''' httpretty.register_uri( httpretty.POST, 'https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=', body=open(os.path.join(TEST_DATA, 'bug-81871.xml')).read(), ) bugzilla = Bugzilla('', '') bug = bugzilla.get_bug(81871) self.assertEqual(bug.bug_id, '81871') self.assertTrue(bug.has_nonempty('flags')) self.assertEqual(len(bug.flags), 2)
def test_get_multiple_flag_bug(self): ''' Test that multiple flags can be handled as well. ''' httpretty.register_uri( httpretty.POST, 'https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=', body=open(os.path.join(TEST_DATA, 'bug-81871.xml')).read(), ) bugzilla = Bugzilla('', '') bug = bugzilla.get_bug(81871) self.assertEqual(bug.bug_id, '81871') self.assertTrue(bug.has_nonempty('flags')) self.assertEqual(len(bug.flags), 2)
def test_get_multiple_flag_bug(self): """ Test that multiple flags can be handled as well. """ httpretty.register_uri( httpretty.POST, "https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=", body=open(os.path.join(TEST_DATA, "bug-81871.xml")).read(), ) bugzilla = Bugzilla("", "") bug = bugzilla.get_bug(81871) self.assertEqual(bug.bug_id, "81871") self.assertTrue(bug.has_nonempty("flags")) self.assertEqual(len(bug.flags), 2)
def test_get_flag_bug(self): ''' Test that the bugzilla-flag are parsed as well. ''' httpretty.register_uri( httpretty.POST, 'https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=', body=open(os.path.join(TEST_DATA, 'bug-81872.xml')).read(), ) bugzilla = Bugzilla('', '') bug = bugzilla.get_bug(81872) self.assertEqual(bug.bug_id, '81872') self.assertTrue(bug.has_nonempty('flags')) flag = bug.flags[0] self.assertEqual(flag['name'], 'needinfo')
def test_get_flag_bug(self): ''' Test that the bugzilla-flag are parsed as well. ''' httpretty.register_uri( httpretty.POST, 'https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=', body=open(os.path.join(TEST_DATA, 'bug-81872.xml')).read(), ) bugzilla = Bugzilla('', '') bug = bugzilla.get_bug(81872) self.assertEqual(bug.bug_id, '81872') self.assertTrue(bug.has_nonempty('flags')) flag = bug.flags[0] self.assertEqual(flag['name'], 'needinfo')
def test_get_flag_bug(self): """ Test that the bugzilla-flag are parsed as well. """ httpretty.register_uri( httpretty.POST, "https://bugzilla.novell.com/show_bug.cgi?ctype=xml&id=", body=open(os.path.join(TEST_DATA, "bug-81872.xml")).read(), ) bugzilla = Bugzilla("", "") bug = bugzilla.get_bug(81872) self.assertEqual(bug.bug_id, "81872") self.assertTrue(bug.has_nonempty("flags")) flag = bug.flags[0] self.assertEqual(flag["name"], "needinfo")