コード例 #1
0
    def test_edit_file(self, gitfs_log):
        content = "first part"
        continuation = "second part"
        filename = "{}/some_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write(content)

        with pull(self.sh):
            with open(filename) as f:
                assert f.read() == content

            self.assert_new_commit()

        with pull(self.sh):
            self.assert_commit_message("Update /some_file")

            with gitfs_log("SyncWorker: Set push_successful"):
                with open(filename, "w") as f:
                    f.write(continuation)

        with pull(self.sh):
            with open(filename) as f:
                assert f.read() == continuation

            self.assert_new_commit()

        with pull(self.sh):
            self.assert_commit_message("Update /some_file")
コード例 #2
0
ファイル: test_repository.py プロジェクト: tuxxon/gitfs
    def test_delete_file(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())

        self.sh.touch(file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(
            ["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        self.sh.rm(file_name)

        self.sh.git.rm(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(
            ["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        assert not os.path.exists(self.current_path + "/" + file_name)
        assert os.path.exists("%s/history/%s/%s" % (
            self.mount_path,
            self.get_commit_dates()[0],
            self.get_commits_by_date()[0],
        ))
コード例 #3
0
ファイル: test_repository.py プロジェクト: krodyrobi/gitfs
    def test_chmod(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())

        self.sh.touch(file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        self.sh.chmod("755", file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        assert os.path.exists("%s/history/%s/%s" % (
            self.mount_path,
            self.get_commit_dates()[0],
            self.get_commits_by_date()[0]
        ))
        assert oct(
            os.stat(self.current_path + "/" + file_name).st_mode & 0o755
        ) == oct(0o755)
コード例 #4
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_edit_file(self, gitfs_log):
        content = "first part"
        continuation = "second part"
        filename = "{}/some_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write(content)

        with pull(self.sh):
            with open(filename) as f:
                assert f.read() == content

            self.assert_new_commit()

        with pull(self.sh):
            self.assert_commit_message("Update /some_file")

            with gitfs_log("SyncWorker: Set push_successful"):
                with open(filename, "w") as f:
                    f.write(continuation)

        with pull(self.sh):
            with open(filename) as f:
                assert f.read() == continuation

            self.assert_new_commit()

        with pull(self.sh):
            self.assert_commit_message("Update /some_file")
コード例 #5
0
ファイル: test_repository.py プロジェクト: tuxxon/gitfs
    def test_chmod(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())

        self.sh.touch(file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(
            ["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        self.sh.chmod("755", file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(
            ["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        assert os.path.exists("{}/history/{}/{}".format(
            self.mount_path,
            self.get_commit_dates()[0],
            self.get_commits_by_date()[0],
        ))
        assert oct(
            os.stat(self.current_path + "/" + file_name).st_mode
            & 0o755) == oct(0o755)
コード例 #6
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_delete_a_directory(self, gitfs_log):
        path = "{}/a_directory/another_dir/".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(path)

        with pull(self.sh):
            self.assert_new_commit()

        with gitfs_log("SyncWorker: Set push_successful"):
            shutil.rmtree("{}/a_directory/".format(self.current_path))

        with pull(self.sh):
            self.assert_commit_message("Update 2 items. Removed 2 items.")
            self.assert_new_commit()

        assert os.path.exists(path) is False
コード例 #7
0
    def test_delete_a_directory(self, gitfs_log):
        path = "{}/a_directory/another_dir/".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(path)

        with pull(self.sh):
            self.assert_new_commit()

        with gitfs_log("SyncWorker: Set push_successful"):
            shutil.rmtree("{}/a_directory/".format(self.current_path))

        with pull(self.sh):
            self.assert_commit_message("Update 2 items. Removed 2 items.")
            self.assert_new_commit()

        assert os.path.exists(path) is False
コード例 #8
0
ファイル: test_repository.py プロジェクト: pkdevboxy/gitfs
    def test_edit_file(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())
        content = "some content"

        self.sh.touch(file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        self.sh.git.push("origin", "master")

        with open(os.path.join(self.remote_repo_path, file_name), "w") as f:
            f.write(content)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        with open(self.repo_path + "/" + file_name) as f:
            assert f.read() == content

        assert os.path.exists(self.current_path + "/" + file_name)
        assert os.path.exists("%s/history/%s/%s" % (
            self.mount_path,
            self.get_commit_dates()[0],
            self.get_commits_by_date()[0]
        ))
コード例 #9
0
    def test_create_directory_inside_an_already_existing_directory(
            self, gitfs_log):
        directory = "{}/directory/new-embedded-directory".format(
            self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/directory/new-embedded-directory".format(
                self.repo_path)
            assert os.path.exists(directory_path)

            # check the existence of the .keep files
            keep_files = [
                "{}/directory/.keep".format(self.repo_path),
                "{}/directory/new-embedded-directory/.keep".format(
                    self.repo_path)
            ]
            for keep_file in keep_files:
                assert os.path.exists(keep_file)

            self.assert_new_commit()
            commit_msg = "Create the /directory/new-embedded-directory directory"
            self.assert_commit_message(commit_msg)
コード例 #10
0
ファイル: test_repository.py プロジェクト: tuxxon/gitfs
    def test_edit_file(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())
        content = "some content"

        self.sh.touch(file_name)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        self.sh.git.push("origin", "master")

        with open(os.path.join(self.remote_repo_path, file_name), "w") as f:
            f.write(content)

        self.sh.git.add(file_name)
        self.sh.git.commit("-m", '"Just a message."')
        with gitfs_log(
            ["FetchWorker: Fetch done", "SyncWorker: Set push_successful"]):
            self.sh.git.push("origin", "master")

        with open(self.repo_path + "/" + file_name) as f:
            assert f.read() == content

        assert os.path.exists(self.current_path + "/" + file_name)
        assert os.path.exists("%s/history/%s/%s" % (
            self.mount_path,
            self.get_commit_dates()[0],
            self.get_commits_by_date()[0],
        ))
コード例 #11
0
    def test_delete_file(self, gitfs_log):
        filename = "{}/deletable_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write("some content")

        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Update /deletable_file")

        with gitfs_log("SyncWorker: Set push_successful"):
            os.remove(filename)

        with pull(self.sh):
            assert not os.path.exists(filename)
            self.assert_commit_message("Deleted /deletable_file")
コード例 #12
0
    def test_rename_directory(self, gitfs_log):
        old_dir = "{}/a_directory/".format(self.current_path)
        new_dir = "{}/some_directory/".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(old_dir)

        with pull(self.sh):
            self.assert_new_commit()

        with gitfs_log("SyncWorker: Set push_successful"):
            os.rename(old_dir, new_dir)

        with pull(self.sh):
            self.assert_new_commit()

        assert os.path.isdir(new_dir) is not False
        assert os.path.exists(old_dir) is False
コード例 #13
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_create(self, gitfs_log):
        filename = "{}/new_empty_file".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            open(filename, "a").close()

        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Created /new_empty_file")
コード例 #14
0
    def test_create(self, gitfs_log):
        filename = "{}/new_empty_file".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            open(filename, "a").close()

        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Created /new_empty_file")
コード例 #15
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_delete_file(self, gitfs_log):
        filename = "{}/deletable_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write("some content")

        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Update /deletable_file")

        with gitfs_log("SyncWorker: Set push_successful"):
            os.remove(filename)

        with pull(self.sh):
            assert not os.path.exists(filename)
            self.assert_commit_message("Deleted /deletable_file")
コード例 #16
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_rename_directory(self, gitfs_log):
        old_dir = "{}/a_directory/".format(self.current_path)
        new_dir = "{}/some_directory/".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(old_dir)

        with pull(self.sh):
            self.assert_new_commit()

        with gitfs_log("SyncWorker: Set push_successful"):
            os.rename(old_dir, new_dir)

        with pull(self.sh):
            self.assert_new_commit()

        assert os.path.isdir(new_dir) is not False
        assert os.path.exists(old_dir) is False
コード例 #17
0
    def test_fsync(self, gitfs_log):
        filename = "{}/me".format(self.current_path)
        content = "test fsync"

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write(content)
                os.fsync(f.fileno())

        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Update 1 items. Added 2 items.")
コード例 #18
0
ファイル: test_write.py プロジェクト: pkdevboxy/gitfs
    def test_chmod_valid_mode(self, gitfs_log):
        filename = "%s/testing" % self.current_path
        with gitfs_log("SyncWorker: Set push_successful"):
            os.chmod(filename, 0755)

        with pull(self.sh):
            # check if the right mode was set
            stats = os.stat(filename)
            assert stats.st_mode == 0100755

            self.assert_new_commit()
            self.assert_commit_message("Chmod to 0755 on /testing")
コード例 #19
0
    def test_chmod_valid_mode(self, gitfs_log):
        filename = "{}/testing".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.chmod(filename, 0o755)

        with pull(self.sh):
            # check if the right mode was set
            stats = os.stat(filename)
            assert stats.st_mode == 0o100755

            self.assert_new_commit()
            self.assert_commit_message("Chmod to 0755 on /testing")
コード例 #20
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_fsync(self, gitfs_log):
        filename = "{}/me".format(self.current_path)
        content = "test fsync"

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write(content)
                os.fsync(f.fileno())

        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Update 1 items. Added 2 items.")
コード例 #21
0
    def test_symbolic_link(self, gitfs_log):
        target = "me"
        name = "{}/links".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.symlink(target, name)

        with pull(self.sh):
            # check if link exists
            assert os.path.exists(name)

            self.assert_new_commit()
            self.assert_commit_message("Create symlink to {} for "
                                       "/links".format(target))
コード例 #22
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_rename(self, gitfs_log):
        old_filename = "{}/testing".format(self.current_path)
        new_filename = "{}/new_testing".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.rename(old_filename, new_filename)

        with pull(self.sh):
            # check for new file
            assert os.path.exists(new_filename)

            self.assert_new_commit()
            self.assert_commit_message("Rename /testing to /new_testing")
コード例 #23
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_symbolic_link(self, gitfs_log):
        target = "me"
        name = "{}/links".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.symlink(target, name)

        with pull(self.sh):
            # check if link exists
            assert os.path.exists(name)

            self.assert_new_commit()
            self.assert_commit_message("Create symlink to {} for "
                                       "/links".format(target))
コード例 #24
0
    def test_rename(self, gitfs_log):
        old_filename = "{}/testing".format(self.current_path)
        new_filename = "{}/new_testing".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.rename(old_filename, new_filename)

        with pull(self.sh):
            # check for new file
            assert os.path.exists(new_filename)

            self.assert_new_commit()
            self.assert_commit_message("Rename /testing to /new_testing")
コード例 #25
0
    def test_delete_directory_with_space_within_name(self, gitfs_log):
        directory = "{}/new directory".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)
        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/new directory".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check for .keep file
            keep_path = "{}/new directory/.keep".format(self.repo_path)
            assert os.path.exists(keep_path)

            self.assert_new_commit()
            self.assert_commit_message("Create the /new directory directory")

        with gitfs_log("SyncWorker: Set push_successful"):
            shutil.rmtree("{}/new directory/".format(self.current_path))

        with pull(self.sh):
            self.assert_new_commit()

        assert os.path.exists(directory) is False
コード例 #26
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_delete_directory_with_space_within_name(self, gitfs_log):
        directory = "{}/new directory".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)
        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/new directory".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check for .keep file
            keep_path = "{}/new directory/.keep".format(self.repo_path)
            assert os.path.exists(keep_path)

            self.assert_new_commit()
            self.assert_commit_message("Create the /new directory directory")

        with gitfs_log("SyncWorker: Set push_successful"):
            shutil.rmtree("{}/new directory/".format(self.current_path))

        with pull(self.sh):
            self.assert_new_commit()

        assert os.path.exists(directory) is False
コード例 #27
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_link_a_file(self, gitfs_log):
        filename = "{}/link_file".format(self.current_path)
        link_name = "{}/new_link".format(self.current_path)

        with open(filename, "w") as f:
            f.write("some content")

        with gitfs_log("SyncWorker: Set push_successful"):
            os.link(filename, link_name)

        with pull(self.sh):
            self.assert_commit_message("Update 2 items. Added 2 items.")

        is_link = os.path.isfile(link_name)
        assert is_link is not False
コード例 #28
0
    def test_link_a_file(self, gitfs_log):
        filename = "{}/link_file".format(self.current_path)
        link_name = "{}/new_link".format(self.current_path)

        with open(filename, "w") as f:
            f.write("some content")

        with gitfs_log("SyncWorker: Set push_successful"):
            os.link(filename, link_name)

        with pull(self.sh):
            self.assert_commit_message("Update 2 items. Added 2 items.")

        is_link = os.path.isfile(link_name)
        assert is_link is not False
コード例 #29
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_write_a_file(self, gitfs_log):
        content = "Just a small file"
        filename = "{}/new_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write(content)

        # check if the write was done correctly
        with open(filename) as f:
            assert f.read() == content

        # check if a commit was made
        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Update /new_file")
コード例 #30
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_create_a_directory(self, gitfs_log):
        directory = "{}/new_directory".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/new_directory".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check for .keep file
            keep_path = "{}/new_directory/.keep".format(self.repo_path)
            assert os.path.exists(keep_path)

            self.assert_new_commit()
            self.assert_commit_message("Create the /new_directory directory")
コード例 #31
0
    def test_write_a_file(self, gitfs_log):
        content = "Just a small file"
        filename = "{}/new_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            with open(filename, "w") as f:
                f.write(content)

        # check if the write was done correctly
        with open(filename) as f:
            assert f.read() == content

        # check if a commit was made
        with pull(self.sh):
            self.assert_new_commit()
            self.assert_commit_message("Update /new_file")
コード例 #32
0
    def test_create_a_directory(self, gitfs_log):
        directory = "{}/new_directory".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/new_directory".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check for .keep file
            keep_path = "{}/new_directory/.keep".format(self.repo_path)
            assert os.path.exists(keep_path)

            self.assert_new_commit()
            self.assert_commit_message("Create the /new_directory directory")
コード例 #33
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_create_multiple_files(self, gitfs_log):
        content = "Just a small file"
        no_of_files = 10
        filename = "{}/new_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            for i in range(no_of_files):
                with open(filename + str(i), "w") as f:
                    f.write(content)

        with pull(self.sh):
            for i in range(no_of_files):
                with open(filename + str(i)) as f:
                    assert f.read() == content

            self.assert_new_commit()

        with pull(self.sh):
            self.assert_commit_message("Update {} items. Added {} items.".format(no_of_files, no_of_files))
コード例 #34
0
    def test_create_multiple_files(self, gitfs_log):
        content = "Just a small file"
        no_of_files = 10
        filename = "{}/new_file".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            for i in range(no_of_files):
                with open(filename + str(i), "w") as f:
                    f.write(content)

        with pull(self.sh):
            for i in range(no_of_files):
                with open(filename + str(i)) as f:
                    assert f.read() == content

            self.assert_new_commit()

        with pull(self.sh):
            self.assert_commit_message("Update {} items".format(no_of_files))
コード例 #35
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_create_embedded_directory(self, gitfs_log):
        directory = "{}/directory/embedded-directory".format(self.current_path)
        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/directory/embedded-directory".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check the existence of the .keep files
            keep_files = [
                "{}/directory/.keep".format(self.repo_path),
                "{}/directory/embedded-directory/.keep".format(self.repo_path)
            ]
            for keep_file in keep_files:
                assert os.path.exists(keep_file)

            self.assert_new_commit()
            commit_msg = "Update 2 items. Added 2 items."
            self.assert_commit_message(commit_msg)
コード例 #36
0
ファイル: test_write.py プロジェクト: pkdevboxy/gitfs
    def test_create_directory_inside_an_already_existing_directory(self, gitfs_log):
        directory = "%s/directory/new-embedded-directory" % self.current_path

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "%s/directory/new-embedded-directory" % self.repo_path
            assert os.path.exists(directory_path)

            # check the existence of the .keep files
            keep_files = [
                "%s/directory/.keep" % self.repo_path,
                "%s/directory/new-embedded-directory/.keep" % self.repo_path
            ]
            for keep_file in keep_files:
                assert os.path.exists(keep_file)

            self.assert_new_commit()
            commit_msg = "Create the /directory/new-embedded-directory directory"
            self.assert_commit_message(commit_msg)
コード例 #37
0
    def test_create_embedded_directory_on_multiple_levels(self, gitfs_log):
        directory = "{}/a/b/c".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/a/b/c".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check the existence of the .keep files
            keep_files = [
                "{}/a/.keep".format(self.repo_path),
                "{}/a/b/.keep".format(self.repo_path),
                "{}/a/b/c/.keep".format(self.repo_path),
            ]
            for keep_file in keep_files:
                assert os.path.exists(keep_file)

            self.assert_new_commit()
            commit_msg = "Update {} items".format(len(keep_files))
            self.assert_commit_message(commit_msg)
コード例 #38
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_create_embedded_directory_on_multiple_levels(self, gitfs_log):
        directory = "{}/a/b/c".format(self.current_path)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(directory)

        with pull(self.sh):
            # check if directory exists or not
            directory_path = "{}/a/b/c".format(self.repo_path)
            assert os.path.exists(directory_path)

            # check the existence of the .keep files
            keep_files = [
                "{}/a/.keep".format(self.repo_path),
                "{}/a/b/.keep".format(self.repo_path),
                "{}/a/b/c/.keep".format(self.repo_path),
            ]
            for keep_file in keep_files:
                assert os.path.exists(keep_file)

            self.assert_new_commit()
            commit_msg = "Update {} items. Added {} items.".format(len(keep_files), len(keep_files))
            self.assert_commit_message(commit_msg)
コード例 #39
0
ファイル: test_write.py プロジェクト: PressLabs/gitfs
    def test_create_embedded_directory_big_depth(self, gitfs_log):
        path = ""
        for letter in string.ascii_lowercase:
            path = os.path.join(path, letter)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(os.path.join(self.current_path, path))

        with pull(self.sh):
            # check if directory exists or not
            directory_path = os.path.join(self.repo_path, path)
            assert os.path.exists(directory_path)

            # build the paths for the keep files
            keep_files = []
            path = self.repo_path
            for letter in string.ascii_lowercase:
                path = os.path.join(path, letter)
                path_with_keep = os.path.join(path, '.keep')
                keep_files.append(path_with_keep)

            # check the existence of the .keep files
            for keep_file in keep_files:
                assert os.path.exists(keep_file)
コード例 #40
0
    def test_create_embedded_directory_big_depth(self, gitfs_log):
        path = ""
        for letter in string.ascii_lowercase:
            path = os.path.join(path, letter)

        with gitfs_log("SyncWorker: Set push_successful"):
            os.makedirs(os.path.join(self.current_path, path))

        with pull(self.sh):
            # check if directory exists or not
            directory_path = os.path.join(self.repo_path, path)
            assert os.path.exists(directory_path)

            # build the paths for the keep files
            keep_files = []
            path = self.repo_path
            for letter in string.ascii_lowercase:
                path = os.path.join(path, letter)
                path_with_keep = os.path.join(path, '.keep')
                keep_files.append(path_with_keep)

            # check the existence of the .keep files
            for keep_file in keep_files:
                assert os.path.exists(keep_file)