Пример #1
0
    def test_repository_list_with_filters_gists_eq(self):
        repo = github_repo.GithubRepo(self.domain_events)

        self._check_results(
            repo.list(filters={'type': 'gists'},
                      body=["AndresJejen"],
                      mock=self.mockEvents), self.domain_events)
def query():
    request_object = r_E_uc.EventListRequestObject.from_dict({})

    repo = gr.GithubRepo()
    use_case = E_uc.EventListUseCase(repo)

    response = use_case.execute(request_object)

    return Response(json.dumps(response.value),
                    mimetype='application/json',
                    status=200)
Пример #3
0
 def test_repository_list_with_filters_gists_from_api_wrong_user(self):
     repo = github_repo.GithubRepo()
     result = repo.list(filters={'type': 'gists'}, body=["AndresaJejen"])
     self.assertEqual(len(result), 0)
Пример #4
0
 def test_repository_list_with_filters_events_from_api(self):
     repo = github_repo.GithubRepo()
     result = repo.list(filters={'type': 'events'}, body=["AndresJejen"])
     self.assertGreater(len(result.keys()), 0)
Пример #5
0
    def test_repository_list_with_filters_unknown_operator(self):
        repo = github_repo.GithubRepo(self.domain_events)

        with self.assertRaises(ValueError) as context:
            repo.list(filters={'__in': [20, 30]})
Пример #6
0
    def test_repository_list_with_body_not_string_list(self):
        repo = github_repo.GithubRepo(self.domain_events)

        with self.assertRaises(ValueError) as context:
            repo.list(filters={'type': 'events'}, body=["1", "2", 2])
Пример #7
0
    def test_repository_list_with_filters_unknown_key(self):
        repo = github_repo.GithubRepo(self.domain_events)

        with self.assertRaises(ValueError) as context:
            repo.list(filters={'weird': 'events'})
Пример #8
0
    def test_repository_list_with_empty_parameters(self):
        repo = github_repo.GithubRepo(self.domain_events)

        with self.assertRaises(ValueError) as context:
            repo.list({})