finished adding --yes

This commit is contained in:
Paul Gauthier 2023-05-11 17:51:50 -07:00
parent 4c97d4e654
commit 8a60462167
2 changed files with 13 additions and 13 deletions

View file

@ -10,7 +10,7 @@ class TestMain(TestCase):
def test_main_with_empty_dir_no_files_on_command(self):
with tempfile.TemporaryDirectory() as temp_dir:
os.chdir(temp_dir)
with open(os.devnull, 'r') as dev_null:
with open(os.devnull, "r") as dev_null:
save_stdin = sys.stdin
sys.stdin = dev_null
main()
@ -19,19 +19,19 @@ class TestMain(TestCase):
def test_main_with_empty_dir_new_file(self):
with tempfile.TemporaryDirectory() as temp_dir:
os.chdir(temp_dir)
with open(os.devnull, 'r') as dev_null:
with open(os.devnull, "r") as dev_null:
save_stdin = sys.stdin
sys.stdin = dev_null
main(['foo.txt'])
main(["foo.txt"])
sys.stdin = save_stdin
self.assertTrue(os.path.exists('foo.txt'))
self.assertTrue(os.path.exists("foo.txt"))
def test_main_with_empty_git_dir_new_file(self):
with tempfile.TemporaryDirectory() as temp_dir:
os.chdir(temp_dir)
subprocess.run(["git", "init"])
with open(os.devnull, 'r') as dev_null:
with open(os.devnull, "r") as dev_null:
save_stdin = sys.stdin
sys.stdin = dev_null
main(['foo.txt'])
main(["--yes", "foo.txt"])
sys.stdin = save_stdin