def setUp(self): testutil.cleanup() testutil.init_repo('foo.git') git = Git(os.path.join(testutil.GIT_DIR, 'foo.git')) testutil.create_empty_branch(git.repo) self.git = git app = create_app(testutil.GIT_DIR) self.client = Client(app, BaseResponse)
def setUp(self): testutil.cleanup() testutil.init_repo('foo.git') git = Git(os.path.join(testutil.GIT_DIR, 'foo.git')) self.assertEqual(git.branches(), {}, 'no branches yet') testutil.create_empty_branch(git.repo) self.git = Git(os.path.join(testutil.GIT_DIR, 'foo.git'))
def test_find_git_dir(self): testutil.init_repo("bar.git") testutil.init_repo("baz") app = create_app(testutil.GIT_DIR) self.assertTrue(app.find_git_dir("bar")) self.assertTrue(app.find_git_dir("bar.git")) self.assertTrue(app.find_git_dir("baz")) self.assertFalse(app.find_git_dir("baz.git")) res = self.client.get("/bar/branches") self.assertEqual(res.status_code, 200, 'repository is accessible w/o ".git"') res = self.client.get("/bar.git/branches") self.assertEqual(res.status_code, 200, 'repository is accessible w/ ".git"') res = self.client.get("/baz/branches") self.assertEqual(res.status_code, 200, 'repository is accessible w/o ".git"') res = self.client.get("/baz.git/branches") self.assertEqual(res.status_code, 404, "repository is not accessible w/ unnecessary ext")