@@ -70,8 +70,15 @@ def test_whenEmptyKeepAliveFileExists_shouldRestartVim(
70
70
"""Test that we can use the keep alive file to have zorg re-run vim."""
71
71
zettel_dir = tmp_path / "org"
72
72
73
- c .keep_alive_file_path .touch ()
74
- exit_code = main ("--dir" , str (zettel_dir ), "edit" , "foobar.zo" )
73
+ keep_alive_file = tmp_path / "zorg_keep_alive"
74
+ keep_alive_file .touch ()
75
+ exit_code = main (
76
+ "--dir" ,
77
+ str (zettel_dir ),
78
+ "edit" ,
79
+ "foobar.zo" ,
80
+ keep_alive_file = keep_alive_file ,
81
+ )
75
82
76
83
assert exit_code == 0
77
84
vim_proc_mock .assert_called_with (
@@ -81,7 +88,7 @@ def test_whenEmptyKeepAliveFileExists_shouldRestartVim(
81
88
timeout = None ,
82
89
)
83
90
assert vim_proc_mock .call_count == 2
84
- assert not c . keep_alive_file_path .exists ()
91
+ assert not keep_alive_file .exists ()
85
92
86
93
87
94
def test_whenKeepAliveFileContainsPaths_useThosePathsOnRestart (
@@ -90,8 +97,15 @@ def test_whenKeepAliveFileContainsPaths_useThosePathsOnRestart(
90
97
"""Test that we can use the keep alive file to change our vim file args."""
91
98
zettel_dir = tmp_path / "org"
92
99
93
- c .keep_alive_file_path .write_text ("baz.zo buz.zo" )
94
- exit_code = main ("--dir" , str (zettel_dir ), "edit" , "foobar.zo" )
100
+ keep_alive_file = tmp_path / "zorg_keep_alive"
101
+ keep_alive_file .write_text ("baz.zo buz.zo" )
102
+ exit_code = main (
103
+ "--dir" ,
104
+ str (zettel_dir ),
105
+ "edit" ,
106
+ "foobar.zo" ,
107
+ keep_alive_file = keep_alive_file ,
108
+ )
95
109
96
110
assert exit_code == 0
97
111
vim_proc_mock .assert_has_calls ([
@@ -111,4 +125,4 @@ def test_whenKeepAliveFileContainsPaths_useThosePathsOnRestart(
111
125
call ().unwrap (),
112
126
])
113
127
assert vim_proc_mock .call_count == 2
114
- assert not c . keep_alive_file_path .exists ()
128
+ assert not keep_alive_file .exists ()
0 commit comments