def append_assignee_info(bug): link = bug['assignee_link'] if link: bug['assignee'] = get_assignee(link) util.remove_key(bug, 'assignee_link') return bug
def test_append_main_task(self, mock_get_json): bug = basic_info() bug = lp.append_main_bug_task(bug) expected = main_task()["entries"][0] util.remove_key(expected, "bug_target_name") self.assertDictContainsSubset(expected, bug) mock_get_json.assert_called_with(lp.BUG_TASKS_URL.format(bug["id"]))
def test_append_main_task(self, mock_get_json): bug = basic_info() bug = lp.append_main_bug_task(bug) expected = main_task()['entries'][0] util.remove_key(expected, 'bug_target_name') self.assertDictContainsSubset(expected, bug) mock_get_json.assert_called_with(lp.BUG_TASKS_URL.format(bug['id']))
def get_failed_builds(jenkins, job): rng = get_job_build_range(jenkins, job) failed_builds = [] for i in rng: build = get_build(jenkins, job, i) if _failed_build(build): build['bugs'] = find_bugs(build) build['date'] = _timestamp2str(build['timestamp']) util.remove_key(build, 'description') failed_builds.append(build) print('.'), print return failed_builds
def get_builds(jenkins, job, stopline=0): rng = get_job_build_range(jenkins, job) builds = [] for i in rng: build = get_build(jenkins, job, i) timestamp = build['timestamp'] / 1000 if timestamp < stopline: log.info("Stop line {0} for job {1}".format( util.timestamp2str(timestamp), job)) break build['bugs'] = find_bugs(build) build['date'] = util.timestamp2str(timestamp) util.remove_key(build, 'description') builds.append(build) return builds
def test_remove_key(self): map1 = {'a': 1024, 'b': 2, 'c': 3} util.remove_key(map1, 'c') self.assertNotIn('c', map1)
def test_remove_key(self): map1 = {"a": 1024, "b": 2, "c": 3} util.remove_key(map1, "c") self.assertNotIn("c", map1)