Beispiel #1
0
 def test_attachment_parsing(self):
     bugzilla = Bugzilla()
     soup = BeautifulSoup(self._example_attachment)
     attachment_element = soup.find("attachment")
     attachment = bugzilla._parse_attachment_element(attachment_element, self._expected_example_attachment_parsing['bug_id'])
     self.assertTrue(attachment)
     self._assert_dictionaries_equal(attachment, self._expected_example_attachment_parsing)
Beispiel #2
0
 def test_add_cc_to_bug(self):
     bugzilla = Bugzilla()
     bugzilla.browser = MockBrowser()
     bugzilla.authenticate = lambda: None
     expected_stderr = "Adding ['*****@*****.**'] to the CC list for bug 42\n"
     OutputCapture().assert_outputs(self,
                                    bugzilla.add_cc_to_bug,
                                    [42, ["*****@*****.**"]],
                                    expected_stderr=expected_stderr)
Beispiel #3
0
 def test_attachment_parsing(self):
     bugzilla = Bugzilla()
     soup = BeautifulSoup(self._example_attachment)
     attachment_element = soup.find("attachment")
     attachment = bugzilla._parse_attachment_element(
         attachment_element,
         self._expected_example_attachment_parsing['bug_id'])
     self.assertTrue(attachment)
     self._assert_dictionaries_equal(
         attachment, self._expected_example_attachment_parsing)
Beispiel #4
0
    def test_parse_bug_id(self):
        # FIXME: These would be all better as doctests
        bugs = Bugzilla()
        self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345"))
        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345"))
        self.assertEquals(12345, parse_bug_id(bugs.short_bug_url_for_bug_id(12345)))
        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345)))
        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True)))

        # Our bug parser is super-fragile, but at least we're testing it.
        self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345"))
        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345"))
Beispiel #5
0
    def test_parse_bug_id(self):
        # FIXME: These would be all better as doctests
        bugs = Bugzilla()
        self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345"))
        self.assertEquals(
            12345,
            parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345"))
        self.assertEquals(12345,
                          parse_bug_id(bugs.short_bug_url_for_bug_id(12345)))
        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345)))
        self.assertEquals(
            12345, parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True)))

        # Our bug parser is super-fragile, but at least we're testing it.
        self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345"))
        self.assertEquals(
            None,
            parse_bug_id(
                "http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345"))
Beispiel #6
0
    def __init__(self, path):
        MultiCommandTool.__init__(self)

        self._path = path
        self.bugs = Bugzilla()
        self.buildbot = BuildBot()
        self.executive = Executive()
        self._irc = None
        self.user = User()
        self._scm = None
        self._checkout = None
        self.status_server = StatusServer()
Beispiel #7
0
 def test_add_cc_to_bug(self):
     bugzilla = Bugzilla()
     bugzilla.browser = MockBrowser()
     bugzilla.authenticate = lambda: None
     expected_stderr = "Adding ['*****@*****.**'] to the CC list for bug 42\n"
     OutputCapture().assert_outputs(self, bugzilla.add_cc_to_bug, [42, ["*****@*****.**"]], expected_stderr=expected_stderr)
Beispiel #8
0
 def test_attachment_detail_bug_parsing(self):
     bugzilla = Bugzilla()
     self.assertEquals(27314, bugzilla._parse_bug_id_from_attachment_page(self._sample_attachment_detail_page))
Beispiel #9
0
 def test_url_creation(self):
     # FIXME: These would be all better as doctests
     bugs = Bugzilla()
     self.assertEquals(None, bugs.bug_url_for_bug_id(None))
     self.assertEquals(None, bugs.short_bug_url_for_bug_id(None))
     self.assertEquals(None, bugs.attachment_url_for_id(None))
Beispiel #10
0
 def test_attachment_detail_bug_parsing(self):
     bugzilla = Bugzilla()
     self.assertEquals(
         27314,
         bugzilla._parse_bug_id_from_attachment_page(
             self._sample_attachment_detail_page))
Beispiel #11
0
 def test_bug_parsing(self):
     bug = Bugzilla()._parse_bug_page(self._example_bug)
     self._assert_dictionaries_equal(bug,
                                     self._expected_example_bug_parsing)