Commit c68e929 Fix unit-tests

1 file Authored and Committed by pingou a year ago
Fix unit-tests

We were retrieving the commit hash of the wrong repo then trying to
look for it on the right page. This should fix that.

    
 1 @@ -239,11 +239,18 @@
 2               output.data)
 3   
 4           # Try accessing the commit
 5 -         gitrepo = os.path.join(tests.HERE, 'repos', 'test.git')
 6 +         gitrepo = os.path.join(tests.HERE, 'repos', 'forks/test.git')
 7           repo = pygit2.Repository(gitrepo)
 8           master_branch = repo.lookup_branch('master')
 9           first_commit = master_branch.get_object().hex
10   
11 +         output = self.app.get('/forks/test/commits')
12 +         self.assertEqual(output.status_code, 200)
13 +         self.assertIn(first_commit, output.data)
14 +         self.assertIn(
15 +             '<a href="/forks/test/c/%s?branch=master"' % first_commit,
16 +             output.data)
17 + 
18           output = self.app.get('/forks/test/c/%s' % first_commit)
19           self.assertEqual(output.status_code, 200)
20           self.assertIn('<title>Commit - forks/test ', output.data)