@@ -112,7 +112,7 @@ def test_repo_git_obtain_full(
112
112
113
113
@pytest .mark .parametrize (
114
114
# Postpone evaluation of options so fixture variables can interpolate
115
- "constructor,lazy_constructor_options" ,
115
+ "constructor,lazy_constructor_options,has_untracked_files " ,
116
116
[
117
117
[
118
118
GitSync ,
@@ -121,6 +121,16 @@ def test_repo_git_obtain_full(
121
121
"dir" : tmp_path / "myrepo" ,
122
122
"vcs" : "git" ,
123
123
},
124
+ False ,
125
+ ],
126
+ [
127
+ GitSync ,
128
+ lambda git_remote_repo , tmp_path , ** kwargs : {
129
+ "url" : f"file://{ git_remote_repo } " ,
130
+ "dir" : tmp_path / "myrepo" ,
131
+ "vcs" : "git" ,
132
+ },
133
+ True ,
124
134
],
125
135
[
126
136
create_project ,
@@ -129,6 +139,16 @@ def test_repo_git_obtain_full(
129
139
"dir" : tmp_path / "myrepo" ,
130
140
"vcs" : "git" ,
131
141
},
142
+ False ,
143
+ ],
144
+ [
145
+ create_project ,
146
+ lambda git_remote_repo , tmp_path , ** kwargs : {
147
+ "url" : f"git+file://{ git_remote_repo } " ,
148
+ "dir" : tmp_path / "myrepo" ,
149
+ "vcs" : "git" ,
150
+ },
151
+ True ,
132
152
],
133
153
],
134
154
)
@@ -138,9 +158,16 @@ def test_repo_update_handle_cases(
138
158
mocker : MockerFixture ,
139
159
constructor : ProjectTestFactory ,
140
160
lazy_constructor_options : ProjectTestFactoryLazyKwargs ,
161
+ has_untracked_files : bool ,
141
162
) -> None :
142
163
git_repo : GitSync = constructor (** lazy_constructor_options (** locals ()))
143
164
git_repo .obtain () # clone initial repo
165
+
166
+ if has_untracked_files :
167
+ some_file = git_repo .dir .joinpath ("some_file" )
168
+ with open (some_file , "w" ) as untracked_file :
169
+ untracked_file .write ("some content" )
170
+
144
171
mocka = mocker .spy (git_repo , "run" )
145
172
git_repo .update_repo ()
146
173
0 commit comments