def test_fields(self):
        c = Criteria(Project.OAS)
        c.add_response_fields(Field.KEY, Field.ASSIGNEE)

        self.assertEqual(
            '{"jql": "project = \\"OAS\\"", "fields": ["key", "assignee"]}',
            c.query_json().__str__())
    def test_json(self):
        c = Criteria(Project.OAS)
        c.page_limit(10)
        c.page_start_at(5)

        self.assertEqual(
            '{"jql": "project = \\"OAS\\"", "startAt": 5, "maxResults": 10}',
            c.query_json().__str__())
Ejemplo n.º 3
0
 def search(self, criteria: Criteria):
     res = requests.post(JIRA_ENDPOINT + JIRA_SEARCH_LIST,
                         data=criteria.query_json(),
                         headers={"Content-Type": "application/json"},
                         auth=HTTPBasicAuth(USER, PASS_WORD))
     resJson = json.loads(res.content.decode("utf8"))
     print(resJson)
     return resJson