<commit_before>import os
import time
import uuid

from tests.integrations.base import BaseTest, gitfs_log


class TestRepository(BaseTest):

    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 & 0o777
        ) == "0755"

    def test_new_file(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())
<commit_msg>Fix octal<commit_after>import os
import time
import uuid

from tests.integrations.base import BaseTest, gitfs_log


class TestRepository(BaseTest):

    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)

    def test_new_file(self, gitfs_log):
        file_name = "new_file" + str(uuid.uuid4())

{'fraction_non_alphanumeric': 0.15030408340573415, 'fraction_numerical': 0.013032145960034752, 'mean_word_length': 2.543076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5893592', 'n_tokens_mistral': 797, 'n_tokens_neox': 776, 'n_words': 135}