當前位置: 首頁>>代碼示例>>Python>>正文


Python server.FileSystemBackend類代碼示例

本文整理匯總了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()
開發者ID:atbradley,項目名稱:dulwich,代碼行數:9,代碼來源:test_server.py

示例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'))
開發者ID:ardumont,項目名稱:dulwich,代碼行數:29,代碼來源:test_server.py

示例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'))
開發者ID:ChipJust,項目名稱:dulwich,代碼行數:27,代碼來源:test_server.py

示例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"))
開發者ID:d-paks7,項目名稱:dulwich,代碼行數:20,代碼來源:test_server.py

示例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()
開發者ID:ardumont,項目名稱:dulwich,代碼行數:6,代碼來源:test_server.py

示例6: test_bad_repo_path

    def test_bad_repo_path(self):
        backend = FileSystemBackend()

        self.assertRaises(NotGitRepository,
                          lambda: backend.open_repository('/ups'))
開發者ID:ardumont,項目名稱:dulwich,代碼行數:5,代碼來源:test_server.py

示例7: setUp

 def setUp(self):
     super(FileSystemBackendTests, self).setUp()
     self.path = tempfile.mkdtemp()
     self.repo = Repo.init(self.path)
     self.backend = FileSystemBackend()
開發者ID:ChipJust,項目名稱:dulwich,代碼行數:5,代碼來源:test_server.py


注:本文中的dulwich.server.FileSystemBackend類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。