Skip to content

Commit 7d8c46c

Browse files
committed
Reformat with black.
1 parent 4008d32 commit 7d8c46c

3 files changed

Lines changed: 44 additions & 20 deletions

File tree

relink.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ def replace_one_file_with_symlink(inputdata_root, target_dir, file_path, dry_run
282282
logger.info("%sCreated symbolic link: %s -> %s", INDENT, link_name, link_target)
283283
except OSError as e:
284284
os.rename(link_name + ".tmp", link_name)
285-
logger.error("%sError creating symlink for %s: %s. Skipping.", INDENT, link_name, e)
285+
logger.error(
286+
"%sError creating symlink for %s: %s. Skipping.", INDENT, link_name, e
287+
)
286288

287289

288290
def parse_arguments():

tests/rimport/test_get_files_to_process.py

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def test_single_file_relpath(self, tmp_path):
3939

4040
# Run
4141
files_to_process, result = rimport.get_files_to_process(
42-
file=filename, filelist=None, items_to_process=None,
42+
file=filename,
43+
filelist=None,
44+
items_to_process=None,
4345
)
4446

4547
# Verify
@@ -60,7 +62,9 @@ def test_single_file_abspath(self, tmp_path):
6062

6163
# Run
6264
files_to_process, result = rimport.get_files_to_process(
63-
file=test_file, filelist=None, items_to_process=None,
65+
file=test_file,
66+
filelist=None,
67+
items_to_process=None,
6468
)
6569

6670
# Verify
@@ -87,7 +91,9 @@ def test_filelist_relpath_with_relpaths(self, tmp_path):
8791

8892
# Run
8993
files_to_process, result = rimport.get_files_to_process(
90-
file=None, filelist=filelist_relpath, items_to_process=None,
94+
file=None,
95+
filelist=filelist_relpath,
96+
items_to_process=None,
9197
)
9298

9399
# Verify
@@ -113,7 +119,9 @@ def test_filelist_abspath_with_relpaths(self, tmp_path):
113119

114120
# Run
115121
files_to_process, result = rimport.get_files_to_process(
116-
file=None, filelist=filelist, items_to_process=None,
122+
file=None,
123+
filelist=filelist,
124+
items_to_process=None,
117125
)
118126

119127
# Verify
@@ -140,7 +148,9 @@ def test_filelist_relpath_with_abspaths(self, tmp_path):
140148

141149
# Run
142150
files_to_process, result = rimport.get_files_to_process(
143-
file=None, filelist=filelist_relpath, items_to_process=None,
151+
file=None,
152+
filelist=filelist_relpath,
153+
items_to_process=None,
144154
)
145155

146156
# Verify
@@ -166,7 +176,9 @@ def test_filelist_abspath_with_abspaths(self, tmp_path):
166176

167177
# Run
168178
files_to_process, result = rimport.get_files_to_process(
169-
file=None, filelist=filelist, items_to_process=None,
179+
file=None,
180+
filelist=filelist,
181+
items_to_process=None,
170182
)
171183

172184
# Verify
@@ -178,7 +190,9 @@ def test_filelist_not_found(self):
178190
filelist = "bsfearirn"
179191
assert not os.path.exists(filelist)
180192
files_to_process, result = rimport.get_files_to_process(
181-
file=None, filelist=filelist, items_to_process=None,
193+
file=None,
194+
filelist=filelist,
195+
items_to_process=None,
182196
)
183197
assert result == 2
184198
assert files_to_process is None
@@ -188,7 +202,9 @@ def test_filelist_empty(self, tmp_path):
188202
filelist = tmp_path / "bsfearirn"
189203
filelist.write_text("")
190204
files_to_process, result = rimport.get_files_to_process(
191-
file=None, filelist=filelist, items_to_process=[],
205+
file=None,
206+
filelist=filelist,
207+
items_to_process=[],
192208
)
193209
assert result == 2
194210
assert files_to_process is None
@@ -209,7 +225,9 @@ def test_items_to_process_abspaths(self, tmp_path):
209225

210226
# Run
211227
files_to_process, result = rimport.get_files_to_process(
212-
file=None, filelist=None, items_to_process=filenames,
228+
file=None,
229+
filelist=None,
230+
items_to_process=filenames,
213231
)
214232

215233
# Verify
@@ -230,7 +248,9 @@ def test_items_to_process_relpaths(self, tmp_path):
230248

231249
# Run
232250
files_to_process, result = rimport.get_files_to_process(
233-
file=None, filelist=None, items_to_process=filenames,
251+
file=None,
252+
filelist=None,
253+
items_to_process=filenames,
234254
)
235255

236256
# Verify
@@ -256,7 +276,9 @@ def test_items_to_process_mixpaths(self, tmp_path):
256276

257277
# Run
258278
files_to_process, result = rimport.get_files_to_process(
259-
file=None, filelist=None, items_to_process=filenames,
279+
file=None,
280+
filelist=None,
281+
items_to_process=filenames,
260282
)
261283

262284
# Verify
@@ -286,7 +308,9 @@ def test_single_file_and_list(self, tmp_path):
286308

287309
# Run
288310
files_to_process, result = rimport.get_files_to_process(
289-
file=filename, filelist=filelist, items_to_process=None,
311+
file=filename,
312+
filelist=filelist,
313+
items_to_process=None,
290314
)
291315

292316
# Verify
@@ -297,7 +321,9 @@ def test_single_or_filelist_or_list_required(self):
297321
"""Test that at least one of file, filelist, items_to_process is required"""
298322
# Run
299323
files_to_process, result = rimport.get_files_to_process(
300-
file=None, filelist=None, items_to_process=None,
324+
file=None,
325+
filelist=None,
326+
items_to_process=None,
301327
)
302328

303329
# Verify

tests/rimport/test_main.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,12 @@ def test_empty_filelist(
204204
assert "no filenames found in list" in captured.err
205205

206206
@patch.object(rimport, "ensure_running_as")
207-
def test_requires_file_or_filelist(
208-
self, _mock_ensure_running_as, tmp_path, capsys
209-
):
207+
def test_requires_file_or_filelist(self, _mock_ensure_running_as, tmp_path, capsys):
210208
"""Test that main() returns error code 2 if neither file nor filelist provided."""
211209
inputdata_root = tmp_path / "inputdata"
212210
inputdata_root.mkdir()
213211

214-
result = rimport.main(
215-
["-inputdata", str(inputdata_root)]
216-
)
212+
result = rimport.main(["-inputdata", str(inputdata_root)])
217213

218214
assert result == 2
219215
captured = capsys.readouterr()

0 commit comments

Comments
 (0)