Beispiel #1
0
    def test_hash_from_multiline_contents(self):
        data = "some data\nand some more data"
        hash = dotkeeper.hash_object(contents=data, git_dir = self._git_dir)
        assert hash == "65927aaf6dc83c89b5980b7da5344f9bd968fc28"

        got_data = dotkeeper.cat_file(hash, git_dir = self._git_dir)
        assert got_data == data
Beispiel #2
0
    def test_hash_fron_contents(self):
        data = "some data"
        hash = dotkeeper.hash_object(contents=data, git_dir = self._git_dir)
        assert hash == "7c0646bfd53c1f0ed45ffd81563f30017717ca58"

        got_data = dotkeeper.cat_file(hash, git_dir = self._git_dir)
        assert got_data == data
Beispiel #3
0
    def test_hash_from_file(self, tmpdir):
        assert tmpdir.check()
        f = tmpdir.join("test")
        data = "some data"
        f.write(data)

        hash = dotkeeper.hash_object(filename=str(f), git_dir = self._git_dir)

        assert hash == "7c0646bfd53c1f0ed45ffd81563f30017717ca58"
Beispiel #4
0
 def test_hash_exception(self):
     with pytest.raises(dotkeeper.GitException):
         dotkeeper.hash_object()
Beispiel #5
0
    def test_mk_tree(self):
        data = "some data"
        hash = dotkeeper.hash_object(contents=data,
                git_dir=self._git_dir)

        assert hash == "7c0646bfd53c1f0ed45ffd81563f30017717ca58"