@@ -16,7 +16,9 @@ def _git_repo(path, files):
1616 for name , text in files .items ():
1717 (path / name ).parent .mkdir (parents = True , exist_ok = True )
1818 (path / name ).write_text (text )
19- run = lambda * a : subprocess .run (["git" , * a ], cwd = path , check = True , capture_output = True ) # noqa: E731
19+ run = lambda * a : subprocess .run (
20+ ["git" , * a ], cwd = path , check = True , capture_output = True
21+ ) # noqa: E731
2022 run ("init" , "-q" )
2123 run ("add" , "." )
2224 run ("-c" , "user.name=t" , "-c" , "user.email=t@t" , "commit" , "-qm" , "init" )
@@ -60,7 +62,10 @@ def test_add_pointer_inline_and_skip(project, tmp_path):
6062 assert r0 ["path" ] == "data/x.csv" and r0 ["rows" ] == 2
6163 assert not (project / "catalog" / "gone.md" ).exists ()
6264
63- ds = {d ["id" ]: d for d in build_catalog (load_config (project / "dataherb.config.yml" )).datasets }
65+ ds = {
66+ d ["id" ]: d
67+ for d in build_catalog (load_config (project / "dataherb.config.yml" )).datasets
68+ }
6469 assert ds ["meta" ]["name" ] == "Meta"
6570 assert ds ["raw" ]["resources" ][0 ]["url" ].endswith ("/git/acme/raw/HEAD/data/x.csv" )
6671
@@ -82,7 +87,10 @@ def fake_get(url, headers=None, timeout=20.0):
8287
8388 monkeypatch .setattr (add_mod , "http_get" , fake_get )
8489 assert list_org_repos ("o" , "dataset" ) == ["o/dataset-a" ]
85- assert list_org_repos ("o" , "dataset" , include_archived = True ) == ["o/Dataset-b" , "o/dataset-a" ]
90+ assert list_org_repos ("o" , "dataset" , include_archived = True ) == [
91+ "o/Dataset-b" ,
92+ "o/dataset-a" ,
93+ ]
8694 assert seen [0 ].startswith ("https://api.github.com/orgs/o/repos?" )
8795
8896
@@ -92,7 +100,14 @@ def test_cli_dry_run(project):
92100 (meta_dir / "dataherb.json" ).write_text ("{}" )
93101 res = CliRunner ().invoke (
94102 dataherb ,
95- ["catalog" , "add" , "-c" , str (project / "dataherb.config.yml" ), "--dry-run" , "acme/meta" ],
103+ [
104+ "catalog" ,
105+ "add" ,
106+ "-c" ,
107+ str (project / "dataherb.config.yml" ),
108+ "--dry-run" ,
109+ "acme/meta" ,
110+ ],
96111 )
97112 assert res .exit_code == 0 , res .output
98113 assert "pointer" in res .output and "would add 1 of 1" in res .output
@@ -117,4 +132,7 @@ def test_yml_format(project):
117132 meta_dir .mkdir (parents = True )
118133 (meta_dir / "dataherb.json" ).write_text ("{}" )
119134 add_repos (load_config (project / "dataherb.config.yml" ), ["acme/meta" ], fmt = "yml" )
120- assert yaml .safe_load ((project / "catalog" / "meta.yml" ).read_text ())["repo" ] == "acme/meta"
135+ assert (
136+ yaml .safe_load ((project / "catalog" / "meta.yml" ).read_text ())["repo" ]
137+ == "acme/meta"
138+ )
0 commit comments