Exemple #1
0
    def setUp(self):
        fs = MemoryFS()
        fp = MemoryPath(fs).child("test.iso")
        fp.setContent(iso)

        AbstractFilePathTestCase.setUp(self)

        self.path = ISOPath(fp)
        self.root = self.path
    def setUp(self):
        self.fs = MemoryFS()

        AbstractFilePathTestCase.setUp(self)

        self.path = MemoryPath(fs=self.fs)
        self.root = self.path
        self.all = self.fs._dirs | set(self.fs._store.keys())
        self.all = set(format_memory_path(p, "/") for p in self.all)
Exemple #3
0
 def setUp(self):
     self.fs = MemoryFS()
     self.root = MemoryPath(fs=self.fs, path=("test-dir", ))
     self.root.createDirectory()
Exemple #4
0
 def test_segmentsFrom(self):
     parent = self.Path(path=MemoryPath(fs=MemoryFS()))
     child = parent.child("child").child("another")
     self.assertEqual(child.segmentsFrom(parent), ["child", "another"])
Exemple #5
0
 def test_parent_outside_repo(self):
     repo = self.Path(path=MemoryPath(fs=MemoryFS(), path=("repo", )))
     self.assertEqual(repo.parent(), repo)
Exemple #6
0
 def test_parent(self):
     parent = self.Path(path=MemoryPath(fs=MemoryFS()))
     child = parent.child("child")
     self.assertEqual(child.parent(), parent)