Skip to content

Commit b38fe43

Browse files
committed
Start stubbing out mypy
1 parent 86af184 commit b38fe43

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

src/vcspull/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ def find_home_config_files(
142142
def find_config_files(
143143
path: Optional[Union[list[pathlib.Path], pathlib.Path]] = None,
144144
match: Union[list[str], str] = ["*"],
145-
filetype: list[Literal["json", "yaml"]] = ["json", "yaml"],
145+
filetype: Union[
146+
Literal["json", "yaml", "*"], list[Literal["json", "yaml", "*"]]
147+
] = ["json", "yaml"],
146148
include_home: bool = False,
147149
):
148150
"""Return repos from a directory and match. Not recursive.

tests/test_config_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def test_in_dir(
214214
def test_find_config_path_string(
215215
config_path: pathlib.Path, yaml_config: pathlib.Path, json_config: pathlib.Path
216216
):
217-
config_files = config.find_config_files(path=str(config_path))
217+
config_files = config.find_config_files(path=config_path)
218218

219219
assert yaml_config in config_files
220220
assert json_config in config_files

tests/test_sync.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ def test_updating_remote(
197197
repo_dict = filter_repos([config], name="myclone")[0]
198198
repo = update_repo(repo_dict)
199199
for remote_name, remote_info in repo.remotes().items():
200-
current_remote_url = repo.remote(remote_name).fetch_url.replace("git+", "")
201-
if remote_name in config["remotes"]:
202-
assert (
203-
config["remotes"][remote_name].fetch_url.replace("git+", "")
204-
== current_remote_url
205-
)
206-
207-
elif remote_name == "origin":
208-
assert config["url"].replace("git+", "") == current_remote_url
200+
remote = repo.remote(remote_name)
201+
if remote is not None:
202+
current_remote_url = remote.fetch_url.replace("git+", "")
203+
if remote_name in config["remotes"]:
204+
assert (
205+
config["remotes"][remote_name].fetch_url.replace("git+", "")
206+
== current_remote_url
207+
)
208+
209+
elif remote_name == "origin":
210+
assert config["url"].replace("git+", "") == current_remote_url

0 commit comments

Comments
 (0)