Mercurial > kallithea
changeset 7140:3020943319f7
tests: api: add test for pulling from a custom remote
This test accompanies commit 85d812ab4c64.
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Sun, 11 Feb 2018 21:33:37 +0100 |
parents | 91603c55aa61 |
children | f200ce5efce6 |
files | kallithea/tests/api/api_base.py |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/api/api_base.py Sun Feb 11 13:54:19 2018 +0100 +++ b/kallithea/tests/api/api_base.py Sun Feb 11 21:33:37 2018 +0100 @@ -314,6 +314,23 @@ expected = 'Unable to pull changes from `%s`' % self.REPO self._compare_error(id_, expected, given=response.body) + def test_api_pull_custom_remote(self): + repo_name = u'test_pull_custom_remote' + fixture.create_repo(repo_name, repo_type=self.REPO_TYPE) + + custom_remote_path = os.path.join(Ui.get_by_key('paths', '/').ui_value, self.REPO) + + id_, params = _build_data(self.apikey, 'pull', + repoid=repo_name, + clone_uri=custom_remote_path) + response = api_call(self, params) + + expected = {'msg': 'Pulled from `%s`' % repo_name, + 'repository': repo_name} + self._compare_ok(id_, expected, given=response.body) + + fixture.destroy_repo(repo_name) + def test_api_rescan_repos(self): id_, params = _build_data(self.apikey, 'rescan_repos') response = api_call(self, params)