def test__get_repos_Should_CallAndReturnExpected_When_OrganizationExcludeAttributes( self, read_all_patch, match_repos_patch, *patches): client = GitHubAPI('api.github.com', bearer_token='bearer-token') result = client.get_repos(organization='org1', exclude=['repo1', 'repo2'], archived=False, disabled=False) read_all_patch.assert_called_once_with('/orgs/org1/repos') match_repos_patch.assert_called_once_with( repos=read_all_patch.return_value, owner='org1', include=None, exclude=['repo1', 'repo2'], archived=False, disabled=False) self.assertEqual(result, match_repos_patch.return_value)
def test__get_repos_Should_CallAndReturnExpected_When_UserRegexAttributes( self, read_all_patch, match_repos_patch, *patches): client = GitHubAPI('api.github.com', bearer_token='bearer-token') result = client.get_repos(user='******', include=r'^test_repo.*$', archived=False, disabled=False) read_all_patch.assert_called_once_with('/users/soda480/repos') match_repos_patch.assert_called_once_with( repos=read_all_patch.return_value, owner='soda480', include='^test_repo.*$', exclude=None, archived=False, disabled=False) self.assertEqual(result, match_repos_patch.return_value)