Changeset - 65d45e2fbc33
[Not reviewed]
default
0 1 0
Mads Kiilerich - 7 years ago 2019-01-21 03:57:34
mads@kiilerich.com
Grafted from: 1135cd6c1e87
tests: verify in test_api_pull_remote that a pull from remote updates the tip cache
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/api/api_base.py
Show inline comments
 
@@ -288,6 +288,8 @@ class _BaseTestApi(object):
 
        r.clone_uri = os.path.join(Ui.get_by_key('paths', '/').ui_value, self.REPO)
 
        Session().commit()
 

	
 
        pre_cached_tip = [repo.get_api_data()['last_changeset']['short_id'] for repo in Repository.query().filter(Repository.repo_name == repo_name)]
 

	
 
        id_, params = _build_data(self.apikey, 'pull',
 
                                  repoid=repo_name,)
 
        response = api_call(self, params)
 
@@ -296,8 +298,12 @@ class _BaseTestApi(object):
 
                    'repository': repo_name}
 
        self._compare_ok(id_, expected, given=response.body)
 

	
 
        post_cached_tip = [repo.get_api_data()['last_changeset']['short_id'] for repo in Repository.query().filter(Repository.repo_name == repo_name)]
 

	
 
        fixture.destroy_repo(repo_name)
 

	
 
        assert pre_cached_tip != post_cached_tip
 

	
 
    def test_api_pull_fork(self):
 
        fork_name = u'fork'
 
        fixture.create_fork(self.REPO, fork_name)
0 comments (0 inline, 0 general)