Example #1
0
 def _mkrepo(self):
     t = self.tmpdir()
     paths = utils.touchtree(
         t, 
         [
             "one",
             "dir/two",
         ]
     )
     r = repo.Hippo(
         os.path.join(t, "hippo"),
         t,
     )
     r.init([])
     r.add(["one"])
     r.add(["dir/two"])
     r.commit(["-q", "-a", "-m", "testing"])
     return r
Example #2
0
    def test_make_manifest(self):
        m = meta.Metadata()
        paths = utils.touchtree(
            self.tmpdir(),
            [
                "one",
                "dir1/one",
                "dir1/two",
                "dir2/one",
                "dir2/dir3/one",
            ]
        )

        man = m.make_manifest(paths)
        assert m.parse_manifest(man)

        os.chmod(paths[0], 0)
        assert m.make_manifest(paths) != man

        m.apply_manifest(man)
        assert m.make_manifest(paths) == man