コード例 #1
0
    def test_upload_with_no_review_and_ews(self):
        options = MockOptions()
        options.cc = None
        options.check_style = True
        options.check_style_filter = None
        options.comment = None
        options.description = 'MOCK description'
        options.fast_cq = False
        options.non_interactive = False
        options.request_commit = False
        options.review = False
        options.ews = True
        options.sort_xcode_project = False
        options.suggest_reviewers = False
        expected_logs = """MOCK: user.open_url: file://...
Was that diff correct?
Obsoleting 2 old patches on bug 50000
MOCK reassign_bug: bug_id=50000, assignee=None
MOCK add_patch_to_bug: bug_id=50000, description=MOCK description, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=False
MOCK: user.open_url: http://example.com/50000
MOCK: submit_to_ews: 10001
"""
        self.assert_execute_outputs(Upload(), [50000],
                                    options=options,
                                    expected_logs=expected_logs)
コード例 #2
0
    def test_attach_to_bug_no_description_or_comment(self):
        options = MockOptions()
        options.comment = None
        options.description = None
        expected_stderr = """MOCK add_attachment_to_bug: bug_id=50000, description=file.txt filename=None mimetype=None
"""
        self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt"], options=options, expected_stderr=expected_stderr)
コード例 #3
0
    def test_attach_to_bug_no_description_or_comment(self):
        options = MockOptions()
        options.comment = None
        options.description = None
        expected_stderr = """MOCK add_attachment_to_bug: bug_id=42, description=file.txt filename=None
"""
        self.assert_execute_outputs(AttachToBug(), [42, "path/to/file.txt"], options=options, expected_stderr=expected_stderr)
コード例 #4
0
 def test_attach_to_bug_no_description_or_comment(self):
     options = MockOptions()
     options.comment = None
     options.description = None
     expected_logs = "MOCK add_attachment_to_bug: bug_id=50000, description=file.txt filename=None mimetype=None\n"
     self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt"],
                                 options=options,
                                 expected_logs=expected_logs)
コード例 #5
0
    def test_attach_to_bug(self):
        options = MockOptions()
        options.comment = "extra comment"
        options.description = "file description"
        expected_stderr = """MOCK add_attachment_to_bug: bug_id=50000, description=file description filename=None mimetype=None
-- Begin comment --
extra comment
-- End comment --
"""
        self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt", "file description"], options=options, expected_stderr=expected_stderr)
コード例 #6
0
    def test_attach_to_bug(self):
        options = MockOptions()
        options.comment = "extra comment"
        options.description = "file description"
        expected_logs = """MOCK add_attachment_to_bug: bug_id=50000, description=file description filename=None mimetype=None
-- Begin comment --
extra comment
-- End comment --
"""
        self.assert_execute_outputs(AttachToBug(), [50000, "path/to/file.txt", "file description"], options=options, expected_logs=expected_logs)
コード例 #7
0
    def test_upload(self):
        options = MockOptions()
        options.cc = None
        options.check_style = True
        options.comment = None
        options.description = "MOCK description"
        options.request_commit = False
        options.review = True
        options.suggest_reviewers = False
        expected_stderr = """MOCK: user.open_url: file://...
Was that diff correct?
Obsoleting 2 old patches on bug 42
MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
MOCK: user.open_url: http://example.com/42
"""
        self.assert_execute_outputs(Upload(), [42], options=options, expected_stderr=expected_stderr)
コード例 #8
0
    def test_upload(self):
        options = MockOptions()
        options.description = "MOCK description"
        options.request_commit = False
        options.review = True
        options.comment = None
        options.cc = None
        expected_stderr = """Running check-webkit-style
MOCK: user.open_url: file://...
Obsoleting 2 old patches on bug 42
MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
-- Begin comment --
None
-- End comment --
MOCK: user.open_url: http://example.com/42
"""
        self.assert_execute_outputs(Upload(), [42], options=options, expected_stderr=expected_stderr)
コード例 #9
0
    def test_post(self):
        options = MockOptions()
        options.cc = None
        options.check_style = True
        options.comment = None
        options.description = "MOCK description"
        options.request_commit = False
        options.review = True
        options.suggest_reviewers = False
        expected_stderr = """MOCK: user.open_url: file://...
Was that diff correct?
Obsoleting 2 old patches on bug 42
MOCK reassign_bug: bug_id=42, assignee=None
MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
MOCK: user.open_url: http://example.com/42
"""
        self.assert_execute_outputs(Post(), [42], options=options, expected_stderr=expected_stderr)
コード例 #10
0
    def test_post(self):
        options = MockOptions()
        options.cc = None
        options.check_style = True
        options.check_style_filter = None
        options.comment = None
        options.description = "MOCK description"
        options.request_commit = False
        options.review = True
        options.suggest_reviewers = False
        expected_stderr = """MOCK: user.open_url: file://...
Was that diff correct?
Obsoleting 2 old patches on bug 50000
MOCK reassign_bug: bug_id=50000, assignee=None
MOCK add_patch_to_bug: bug_id=50000, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
MOCK: user.open_url: http://example.com/50000
"""
        self.assert_execute_outputs(Post(), [50000], options=options, expected_stderr=expected_stderr)
コード例 #11
0
    def test_upload(self):
        options = MockOptions()
        options.description = "MOCK description"
        options.request_commit = False
        options.review = True
        options.comment = None
        options.cc = None
        expected_stderr = """Running check-webkit-style
MOCK: user.open_url: file://...
Obsoleting 2 old patches on bug 42
MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
-- Begin comment --
None
-- End comment --
MOCK: user.open_url: http://example.com/42
"""
        self.assert_execute_outputs(Upload(), [42],
                                    options=options,
                                    expected_stderr=expected_stderr)
コード例 #12
0
    def test_upload(self):
        options = MockOptions()
        options.cc = None
        options.check_style = True
        options.check_style_filter = None
        options.comment = None
        options.description = "MOCK description"
        options.request_commit = False
        options.review = True
        options.suggest_reviewers = False
        expected_logs = """MOCK: user.open_url: file://...
Was that diff correct?
Obsoleting 2 old patches on bug 50000
MOCK reassign_bug: bug_id=50000, assignee=None
MOCK add_patch_to_bug: bug_id=50000, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
MOCK: user.open_url: http://example.com/50000
"""
        self.assert_execute_outputs(Upload(), [50000],
                                    options=options,
                                    expected_logs=expected_logs)