# HG changeset patch # User Thomas De Schampheleire # Date 2018-02-11 20:33:37 # Node ID 3020943319f7306212d27326ffbb9b7ac106966b # Parent 91603c55aa61ef778787b42bd5d7bb58f1457282 tests: api: add test for pulling from a custom remote This test accompanies commit 85d812ab4c64. diff --git a/kallithea/tests/api/api_base.py b/kallithea/tests/api/api_base.py --- a/kallithea/tests/api/api_base.py +++ b/kallithea/tests/api/api_base.py @@ -314,6 +314,23 @@ class _BaseTestApi(object): 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)