def get_main_bug_task(bug_id): url = BUG_TASKS_URL.format(bug_id) resp = util.get_json(url) task = resp['entries'][0] task = util.select_keys(task, ['assignee_link', 'bug_target_name', 'importance', 'status']) util.rename_key(task, 'bug_target_name', 'target') return task
def test_select_keys(self): map1 = {'a': 1, 'b': 2, 'c': 3} map2 = util.select_keys(map1, ['a', 'c', 'd']) expected = {'a': 1, 'c': 3, 'd': None} self.assertEqual(expected, map2)
def get_assignee(link): resp = util.get_json(link) return util.select_keys(resp, ['display_name', 'name', 'is_team'])
def get_bug_basic_info(link): resp = util.get_json(link) info = util.select_keys(resp, ['id', 'title', 'duplicate_of_link']) return info
def test_select_keys(self): map1 = {"a": 1, "b": 2, "c": 3} map2 = util.select_keys(map1, ["a", "c", "d"]) expected = {"a": 1, "c": 3, "d": None} self.assertEqual(expected, map2)