def test_parse_bug_id(self): # Test that we can parse the urls we produce. bugs = Bugzilla() self.assertEqual( 12345, urls.parse_bug_id(bugs.short_bug_url_for_bug_id(12345))) self.assertEqual(12345, urls.parse_bug_id(bugs.bug_url_for_bug_id(12345))) self.assertEqual( 12345, urls.parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True)))
def test_url_creation(self): # FIXME: These would be all better as doctests bugs = Bugzilla() self.assertIsNone(bugs.bug_url_for_bug_id(None)) self.assertIsNone(bugs.short_bug_url_for_bug_id(None)) self.assertIsNone(bugs.attachment_url_for_id(None))