Пример #1
0
    def test_from_gerrit_comment_missing_info(self):
        gerrit_comment = (
            'The exported PR for the current patch failed Taskcluster check(s) '
            'on GitHub, which could indict cross-broswer failures on the '
            'exportable changes. Please contact ecosystem-infra@ team for '
            'more information.\n\n'
            'Taskcluster Link: \n'
            'Gerrit CL SHA: num')

        actual = PRStatusInfo.from_gerrit_comment(gerrit_comment)

        self.assertIsNone(actual)
    def test_from_gerrit_comment_success(self):
        gerrit_comment = (
            'The exported PR for the current patch failed Taskcluster check(s) '
            'on GitHub, which could indict cross-broswer failures on the '
            'exportable changes. Please contact ecosystem-infra@ team for '
            'more information.\n\n'
            'Taskcluster Node ID: foo\n'
            'Taskcluster Link: bar\n'
            'Gerrit CL SHA: num')

        actual = PRStatusInfo.from_gerrit_comment(gerrit_comment)

        self.assertEqual(actual.node_id, 'foo')
        self.assertEqual(actual.link, 'bar')
        self.assertEqual(actual.gerrit_sha, 'num')
Пример #3
0
    def test_from_gerrit_comment_fail(self):
        gerrit_comment = 'ABC'

        actual = PRStatusInfo.from_gerrit_comment(gerrit_comment)

        self.assertIsNone(actual)