本文整理汇总了Python中dulwich.server.FileSystemBackend类的典型用法代码示例。如果您正苦于以下问题:Python FileSystemBackend类的具体用法?Python FileSystemBackend怎么用?Python FileSystemBackend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FileSystemBackend类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
super(FileSystemBackendTests, self).setUp()
self.path = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.path)
self.repo = Repo.init(self.path)
if sys.platform == 'win32':
self.backend = FileSystemBackend(self.path[0] + ':' + os.sep)
else:
self.backend = FileSystemBackend()
示例2: FileSystemBackendTests
class FileSystemBackendTests(TestCase):
"""Tests for FileSystemBackend."""
def setUp(self):
super(FileSystemBackendTests, self).setUp()
self.path = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.path)
self.repo = Repo.init(self.path)
self.backend = FileSystemBackend()
def test_nonexistant(self):
self.assertRaises(NotGitRepository,
self.backend.open_repository, "/does/not/exist/unless/foo")
def test_absolute(self):
repo = self.backend.open_repository(self.path)
self.assertEqual(
os.path.normcase(os.path.abspath(repo.path)),
os.path.normcase(os.path.abspath(self.repo.path)))
def test_child(self):
self.assertRaises(NotGitRepository,
self.backend.open_repository, os.path.join(self.path, "foo"))
def test_bad_repo_path(self):
backend = FileSystemBackend()
self.assertRaises(NotGitRepository,
lambda: backend.open_repository('/ups'))
示例3: FileSystemBackendTests
class FileSystemBackendTests(TestCase):
"""Tests for FileSystemBackend."""
def setUp(self):
super(FileSystemBackendTests, self).setUp()
self.path = tempfile.mkdtemp()
self.repo = Repo.init(self.path)
self.backend = FileSystemBackend()
def test_nonexistant(self):
self.assertRaises(NotGitRepository,
self.backend.open_repository, "/does/not/exist/unless/foo")
def test_absolute(self):
repo = self.backend.open_repository(self.path)
self.assertEqual(repo.path, self.repo.path)
def test_child(self):
self.assertRaises(NotGitRepository,
self.backend.open_repository, os.path.join(self.path, "foo"))
def test_bad_repo_path(self):
repo = MemoryRepo.init_bare([], {})
backend = DictBackend({'/': repo})
self.assertRaises(NotGitRepository,
lambda: backend.open_repository('/ups'))
示例4: FileSystemBackendTests
class FileSystemBackendTests(TestCase):
"""Tests for FileSystemBackend."""
def setUp(self):
super(FileSystemBackendTests, self).setUp()
self.path = tempfile.mkdtemp()
self.repo = Repo.init(self.path)
self.backend = FileSystemBackend()
def test_nonexistant(self):
self.assertRaises(NotGitRepository,
self.backend.open_repository, "/does/not/exist/unless/foo")
def test_absolute(self):
repo = self.backend.open_repository(self.path)
self.assertEquals(repo.path, self.repo.path)
def test_child(self):
self.assertRaises(NotGitRepository,
self.backend.open_repository, os.path.join(self.path, "foo"))
示例5: setUp
def setUp(self):
super(FileSystemBackendTests, self).setUp()
self.path = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.path)
self.repo = Repo.init(self.path)
self.backend = FileSystemBackend()
示例6: test_bad_repo_path
def test_bad_repo_path(self):
backend = FileSystemBackend()
self.assertRaises(NotGitRepository,
lambda: backend.open_repository('/ups'))
示例7: setUp
def setUp(self):
super(FileSystemBackendTests, self).setUp()
self.path = tempfile.mkdtemp()
self.repo = Repo.init(self.path)
self.backend = FileSystemBackend()