diff --git a/tests/test_pagure_flask_ui_fork.py b/tests/test_pagure_flask_ui_fork.py index 6981d7e..96ffc6f 100644 --- a/tests/test_pagure_flask_ui_fork.py +++ b/tests/test_pagure_flask_ui_fork.py @@ -66,7 +66,6 @@ class PagureFlaskForktests(tests.Modeltests): pagure.ui.issues.SESSION = self.session pagure.APP.config['GIT_FOLDER'] = os.path.join(tests.HERE, 'repos') - pagure.APP.config['FORK_FOLDER'] = os.path.join(tests.HERE, 'forks') pagure.APP.config['TICKETS_FOLDER'] = os.path.join( tests.HERE, 'tickets') pagure.APP.config['DOCS_FOLDER'] = os.path.join( @@ -588,7 +587,7 @@ class PagureFlaskForktests(tests.Modeltests): tests.create_projects_git( os.path.join(tests.HERE, 'requests'), bare=True) tests.create_projects_git( - os.path.join(tests.HERE, 'forks', 'foo'), bare=True) + os.path.join(tests.HERE, 'repos', 'forks', 'foo'), bare=True) # Create a git repo to play with gitrepo = os.path.join(tests.HERE, 'repos', 'test.git') @@ -598,7 +597,7 @@ class PagureFlaskForktests(tests.Modeltests): # Create a fork of this repo newpath = tempfile.mkdtemp(prefix='pagure-fork-test') - gitrepo = os.path.join(tests.HERE, 'forks', 'foo', 'test.git') + gitrepo = os.path.join(tests.HERE, 'repos', 'forks', 'foo', 'test.git') new_repo = pygit2.clone_repository(gitrepo, newpath) # Edit the sources file again @@ -671,7 +670,7 @@ class PagureFlaskForktests(tests.Modeltests): tests.create_projects_git( os.path.join(tests.HERE, 'requests'), bare=True) tests.create_projects_git( - os.path.join(tests.HERE, 'forks', 'foo'), bare=True) + os.path.join(tests.HERE, 'repos', 'forks', 'foo'), bare=True) # Create a git repo to play with gitrepo = os.path.join(tests.HERE, 'repos', 'test.git') @@ -681,7 +680,8 @@ class PagureFlaskForktests(tests.Modeltests): # Create a fork of this repo newpath = tempfile.mkdtemp(prefix='pagure-fork-test') - gitrepo = os.path.join(tests.HERE, 'forks', 'foo', 'test.git') + gitrepo = os.path.join( + tests.HERE, 'repos', 'forks', 'foo', 'test.git') new_repo = pygit2.clone_repository(gitrepo, newpath) # Create a PR for these "changes" (there are none, both repos are @@ -926,7 +926,7 @@ index 9f44358..2a552bb 100644 tests.create_projects_git( os.path.join(tests.HERE, 'requests'), bare=True) tests.create_projects_git( - os.path.join(tests.HERE, 'forks', 'foo'), bare=True) + os.path.join(tests.HERE, 'repos', 'forks', 'foo'), bare=True) # Create a git repo to play with gitrepo = os.path.join(tests.HERE, 'repos', 'test.git') @@ -936,7 +936,8 @@ index 9f44358..2a552bb 100644 # Create a fork of this repo newpath = tempfile.mkdtemp(prefix='pagure-fork-test') - gitrepo = os.path.join(tests.HERE, 'forks', 'foo', 'test.git') + gitrepo = os.path.join( + tests.HERE, 'repos', 'forks', 'foo', 'test.git') new_repo = pygit2.clone_repository(gitrepo, newpath) # Edit the sources file again @@ -981,7 +982,8 @@ index 9f44358..2a552bb 100644 self.assertEqual(req.id, 1) self.assertEqual(req.title, 'PR from the feature branch') - output = self.app.get('/test/pull-request/1.patch', follow_redirects=True) + output = self.app.get( + '/test/pull-request/1.patch', follow_redirects=True) self.assertEqual(output.status_code, 200) npatch = [] @@ -1038,7 +1040,7 @@ index 0000000..2a552bb tests.create_projects_git( os.path.join(tests.HERE, 'requests'), bare=True) tests.create_projects_git( - os.path.join(tests.HERE, 'forks', 'foo'), bare=True) + os.path.join(tests.HERE, 'repos', 'forks', 'foo'), bare=True) # Create a git repo to play with gitrepo = os.path.join(tests.HERE, 'repos', 'test.git') @@ -1048,7 +1050,8 @@ index 0000000..2a552bb # Create a fork of this repo newpath = tempfile.mkdtemp(prefix='pagure-fork-test') - gitrepo = os.path.join(tests.HERE, 'forks', 'foo', 'test.git') + gitrepo = os.path.join( + tests.HERE, 'repos', 'forks', 'foo', 'test.git') new_repo = pygit2.clone_repository(gitrepo, newpath) # Create a PR for these "changes" (there are none, both repos are @@ -1441,7 +1444,7 @@ index 0000000..2a552bb # Create a fork of this repo newpath = tempfile.mkdtemp(prefix='pagure-fork-test') - gitrepo = os.path.join(tests.HERE, 'forks', 'foo', 'test.git') + gitrepo = os.path.join(tests.HERE, 'repos', 'forks', 'foo', 'test.git') new_repo = pygit2.clone_repository(gitrepo, newpath) user = tests.FakeUser() @@ -1496,7 +1499,8 @@ index 0000000..2a552bb # Create a fork of this repo newpath = tempfile.mkdtemp(prefix='pagure-fork-test') - gitrepo = os.path.join(tests.HERE, 'forks', 'foo', 'test.git') + gitrepo = os.path.join( + tests.HERE, 'repos', 'forks', 'foo', 'test.git') new_repo = pygit2.clone_repository(gitrepo, newpath) user = tests.FakeUser() diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py index 2e31544..6d8f7f1 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -496,13 +496,13 @@ class PagureFlaskRepotests(tests.Modeltests): def test_view_forks(self): """ Test the view_forks endpoint. """ - output = self.app.get('/foo/forks') + output = self.app.get('/foo/forks', follow_redirects=True) self.assertEqual(output.status_code, 404) tests.create_projects(self.session) tests.create_projects_git(tests.HERE, bare=True) - output = self.app.get('/test/forks') + output = self.app.get('/test/forks', follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertTrue('This project has not been forked.' in output.data) @@ -1043,19 +1043,19 @@ class PagureFlaskRepotests(tests.Modeltests): def test_view_commit(self): """ Test the view_commit endpoint. """ - output = self.app.get('/foo/bar') + output = self.app.get('/foo/c/bar') # No project registered in the DB self.assertEqual(output.status_code, 404) tests.create_projects(self.session) - output = self.app.get('/test/bar') + output = self.app.get('/test/c/bar') # No git repo associated self.assertEqual(output.status_code, 404) tests.create_projects_git(tests.HERE, bare=True) - output = self.app.get('/test/bar') + output = self.app.get('/test/c/bar') self.assertEqual(output.status_code, 404) # Add a README to the git repo - First commit @@ -1064,7 +1064,7 @@ class PagureFlaskRepotests(tests.Modeltests): commit = repo.revparse_single('HEAD') # View first commit - output = self.app.get('/test/%s' % commit.oid.hex) + output = self.app.get('/test/c/%s' % commit.oid.hex) self.assertEqual(output.status_code, 200) self.assertTrue( '