@@ -280,24 +280,22 @@ def get_cfg():
280280def test_create_collections (collections , tmpdir , runner ):
281281 runner .write_with_general (
282282 dedent (
283- """
283+ f """
284284 [pair foobar]
285285 a = "foo"
286286 b = "bar"
287- collections = {colls }
287+ collections = { json . dumps ( list ( collections )) }
288288
289289 [storage foo]
290290 type = "filesystem"
291- path = "{base }/foo/"
291+ path = "{ str ( tmpdir ) } /foo/"
292292 fileext = ".txt"
293293
294294 [storage bar]
295295 type = "filesystem"
296- path = "{base }/bar/"
296+ path = "{ str ( tmpdir ) } /bar/"
297297 fileext = ".txt"
298- """ .format (
299- base = str (tmpdir ), colls = json .dumps (list (collections ))
300- )
298+ """
301299 )
302300 )
303301
@@ -315,24 +313,22 @@ def test_create_collections(collections, tmpdir, runner):
315313def test_ident_conflict (tmpdir , runner ):
316314 runner .write_with_general (
317315 dedent (
318- """
316+ f """
319317 [pair foobar]
320318 a = "foo"
321319 b = "bar"
322320 collections = null
323321
324322 [storage foo]
325323 type = "filesystem"
326- path = "{base }/foo/"
324+ path = "{ str ( tmpdir ) } /foo/"
327325 fileext = ".txt"
328326
329327 [storage bar]
330328 type = "filesystem"
331- path = "{base }/bar/"
329+ path = "{ str ( tmpdir ) } /bar/"
332330 fileext = ".txt"
333- """ .format (
334- base = str (tmpdir )
335- )
331+ """
336332 )
337333 )
338334
@@ -371,19 +367,17 @@ def test_ident_conflict(tmpdir, runner):
371367def test_unknown_storage (tmpdir , runner , existing , missing ):
372368 runner .write_with_general (
373369 dedent (
374- """
370+ f """
375371 [pair foobar]
376372 a = "foo"
377373 b = "bar"
378374 collections = null
379375
380376 [storage { existing } ]
381377 type = "filesystem"
382- path = "{base }/{existing}/"
378+ path = "{ str ( tmpdir ) } /{ existing } /"
383379 fileext = ".txt"
384- """ .format (
385- base = str (tmpdir ), existing = existing
386- )
380+ """
387381 )
388382 )
389383
@@ -393,10 +387,8 @@ def test_unknown_storage(tmpdir, runner, existing, missing):
393387 assert result .exception
394388
395389 assert (
396- "Storage '{missing}' not found. "
397- "These are the configured storages: ['{existing}']" .format (
398- missing = missing , existing = existing
399- )
390+ f"Storage '{ missing } ' not found. "
391+ f"These are the configured storages: ['{ existing } ']"
400392 ) in result .output
401393
402394
@@ -416,25 +408,23 @@ def test_no_configured_pairs(tmpdir, runner, cmd):
416408def test_conflict_resolution (tmpdir , runner , resolution , expect_foo , expect_bar ):
417409 runner .write_with_general (
418410 dedent (
419- """
411+ f """
420412 [pair foobar]
421413 a = "foo"
422414 b = "bar"
423415 collections = null
424- conflict_resolution = {val }
416+ conflict_resolution = { json . dumps ( resolution ) }
425417
426418 [storage foo]
427419 type = "filesystem"
428420 fileext = ".txt"
429- path = "{base }/foo"
421+ path = "{ str ( tmpdir ) } /foo"
430422
431423 [storage bar]
432424 type = "filesystem"
433425 fileext = ".txt"
434- path = "{base}/bar"
435- """ .format (
436- base = str (tmpdir ), val = json .dumps (resolution )
437- )
426+ path = "{ str (tmpdir )} /bar"
427+ """
438428 )
439429 )
440430
@@ -526,13 +516,11 @@ def test_fetch_only_necessary_params(tmpdir, runner):
526516 fetch_script = tmpdir .join ("fetch_script" )
527517 fetch_script .write (
528518 dedent (
529- """
519+ f """
530520 set -e
531- touch "{}"
521+ touch "{ str ( fetched_file ) } "
532522 echo ".txt"
533- """ .format (
534- str (fetched_file )
535- )
523+ """
536524 )
537525 )
538526
0 commit comments