Exemplo n.º 1
0
    def test_github_repo(self):
        with patch('dscan.common.update_api.GitRepo.__init__', return_value=None, autospec=True) as gri:
            with patch('dscan.common.update_api.GitRepo.init', autospec=True) as grii:
                returned_gh = github_repo(self.drupal_repo_path, self.plugin_name)
                args, kwargs = gri.call_args

                assert args[1] == self.drupal_gh
                assert args[2] == self.plugin_name

                assert gri.called
                assert grii.called

                assert isinstance(returned_gh, GitRepo)
Exemplo n.º 2
0
    def test_github_repo(self):
        with patch('dscan.common.update_api.GitRepo.__init__',
                   return_value=None,
                   autospec=True) as gri:
            with patch('dscan.common.update_api.GitRepo.init',
                       autospec=True) as grii:
                returned_gh = github_repo(self.drupal_repo_path,
                                          self.plugin_name)
                args, kwargs = gri.call_args

                assert args[1] == self.drupal_gh
                assert args[2] == self.plugin_name

                assert gri.called
                assert grii.called

                assert isinstance(returned_gh, GitRepo)