<commit_before>import subprocess
import sys
import time
import unittest

import sneakersync.main

import test_synchronize_base

class TestMain(test_synchronize_base.TestSynchronizeBase):
    def test_send_receive(self):
        self.drives[0].rename(self.drive)
        
        # with (self.drive / "module_1" / "new").open("w") as fd:
        #     fd.write("new file")
        (self.drive / "module_1" / "foo.1").unlink()
        # with (self.drive / "module_3" / "foo.3").open("w") as fd:
        #     fd.write("Modified file")
        # subprocess.check_call([
        #     "touch", "-a", "-t", "2001" "02" "03" "23" "24" ".25",
        #     self.drive / "module_1" / "subdir" / "bar.1"])
        # subprocess.check_call([
        #     "touch", "-m", "-t", "2002" "03" "04" "22" "21" ".20",
        #     self.drive / "module_3" / "bar.3"])
        
        sys.argv = [sys.argv[0], "send", str(self.sneakerdrive)]
        sneakersync.main.main()
        self.drive.rename(self.drives[0])
        
        time.sleep(1)
        
        self.drives[1].rename(self.drive)
        sys.argv = [sys.argv[0], "receive", str(self.sneakerdrive)]
        sneakersync.main.main()
        self.drive.rename(self.drives[1])
        
        self._check_synchronized()

if __name__ == "__main__":
    sys.exit(unittest.main())<commit_msg>Improve main CLI test<commit_after>import subprocess
import sys
import time
import unittest

import sneakersync.main

import test_synchronize_base

class TestMain(test_synchronize_base.TestSynchronizeBase):
    def test_send_receive(self):
        self.drives[0].rename(self.drive)
        
        with (self.drive / "module_1" / "new").open("w") as fd:
            fd.write("new file")
        (self.drive / "module_1" / "foo.1").unlink()
        with (self.drive / "module_3" / "foo.3").open("w") as fd:
            fd.write("Modified file")
        subprocess.check_call([
            "touch", "-a", "-t", "2001" "02" "03" "23" "24" ".25",
            self.drive / "module_1" / "subdir" / "bar.1"])
        subprocess.check_call([
            "touch", "-m", "-t", "2002" "03" "04" "22" "21" ".20",
            self.drive / "module_3" / "bar.3"])
        
        sys.argv = [sys.argv[0], "send", str(self.sneakerdrive)]
        sneakersync.main.main()
        self.drive.rename(self.drives[0])
        
        time.sleep(1)
        
        self.drives[1].rename(self.drive)
        sys.argv = [sys.argv[0], "receive", str(self.sneakerdrive)]
        sneakersync.main.main()
        self.drive.rename(self.drives[1])
        
        self._check_synchronized()

if __name__ == "__main__":
    sys.exit(unittest.main())
{'fraction_non_alphanumeric': 0.17306245297215953, 'fraction_numerical': 0.03310759969902182, 'mean_word_length': 2.2269417475728157, 'pattern_counts': {'":': 2, '<': 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': '764416', 'n_tokens_mistral': 975, 'n_tokens_neox': 942, 'n_words': 166}