def test_get_annotations_config_not_in_standard_default_branch(self): options = { 'CHECK_RUN_ANNOTATIONS': 'one,two, three', 'GITHUB_REF': 'refs/heads/branch' } config = get_annotations_config(options, None) self.assertEqual([], config)
def test_get_annotations_config_in_all_branches(self): options = { 'CHECK_RUN_ANNOTATIONS': 'one,two, three', 'CHECK_RUN_ANNOTATIONS_BRANCH': '*', 'GITHUB_REF': 'refs/heads/release' } config = get_annotations_config(options, None) self.assertEqual(['one', 'two', 'three'], config)
def test_get_annotations_config_not_in_default_branch(self): options = { 'CHECK_RUN_ANNOTATIONS': 'one,two, three', 'GITHUB_REF': 'refs/heads/branch' } event = {'repository': {'default_branch': 'develop'}} config = get_annotations_config(options, event) self.assertEqual([], config)
def test_get_annotations_config_not_in_specific_branch(self): options = { 'CHECK_RUN_ANNOTATIONS': 'one,two, three', 'CHECK_RUN_ANNOTATIONS_BRANCH': 'release, develop', 'GITHUB_REF': 'refs/heads/branch' } config = get_annotations_config(options, None) self.assertEqual([], config)
def test_get_annotations_config_default(self): config = get_annotations_config({}, None) self.assertEqual(['all tests', 'skipped tests'], config)
def test_get_annotations_config(self): options = {'CHECK_RUN_ANNOTATIONS': 'one,two, three'} config = get_annotations_config(options, None) self.assertEqual(['one', 'two', 'three'], config)