Skip to content

Commit

Permalink
fix typo in trim_pr_json_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ytausch committed Mar 15, 2024
1 parent 6365b70 commit 9483ae9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion conda_forge_tick/auto_tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import tqdm

from .cli_context import CliContext
from .deploy import deploy
from .lazy_json_backends import (
LazyJson,
get_all_keys_for_hashmap,
Expand Down
8 changes: 4 additions & 4 deletions conda_forge_tick/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def delete_branch(ctx: GithubContext, pr_json: LazyJson, dry_run: bool = False)
pr_json["head"]["ref"] = "this_is_not_a_branch"


def trim_pr_josn_keys(
def trim_pr_json_keys(
pr_json: Union[Dict, LazyJson],
src_pr_json: Optional[Union[Dict, LazyJson]] = None,
) -> Union[Dict, LazyJson]:
Expand Down Expand Up @@ -457,11 +457,11 @@ def lazy_update_pr_json(
)

if r.status_code == 200:
pr_json = trim_pr_josn_keys(pr_json, src_pr_json=r.json())
pr_json = trim_pr_json_keys(pr_json, src_pr_json=r.json())

Check warning on line 460 in conda_forge_tick/git_utils.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/git_utils.py#L460

Added line #L460 was not covered by tests
pr_json["ETag"] = r.headers["ETag"]
pr_json["Last-Modified"] = r.headers["Last-Modified"]
else:
pr_json = trim_pr_josn_keys(pr_json)
pr_json = trim_pr_json_keys(pr_json)

Check warning on line 464 in conda_forge_tick/git_utils.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/git_utils.py#L464

Added line #L464 was not covered by tests

return pr_json

Expand Down Expand Up @@ -653,7 +653,7 @@ def push_repo(
# Return a json object so we can remake the PR if needed
pr_dict: dict = pr.as_dict()

return trim_pr_josn_keys(pr_dict)
return trim_pr_json_keys(pr_dict)

Check warning on line 656 in conda_forge_tick/git_utils.py

View check run for this annotation

Codecov / codecov/patch

conda_forge_tick/git_utils.py#L656

Added line #L656 was not covered by tests


def comment_on_pr(pr_json, comment, repo):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_git_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from conda_forge_tick.git_utils import trim_pr_josn_keys
from conda_forge_tick.git_utils import trim_pr_json_keys


def test_trim_pr_json_keys():
Expand All @@ -12,7 +12,7 @@ def test_trim_pr_json_keys():
"base": {"repo": {"namee": "None", "name": "foo"}},
}

pr_json = trim_pr_josn_keys(pr_json)
pr_json = trim_pr_json_keys(pr_json)
assert "random" not in pr_json
assert pr_json["head"] == {}
assert pr_json["base"]["repo"] == {"name": "foo"}
Expand All @@ -30,7 +30,7 @@ def test_trim_pr_json_keys_src():
"base": {"repo": {"namee": "None", "name": "foo"}},
}

pr_json = trim_pr_josn_keys({"r": None}, src_pr_json=src_pr_json)
pr_json = trim_pr_json_keys({"r": None}, src_pr_json=src_pr_json)
assert "random" not in pr_json
assert pr_json["head"] == {}
assert pr_json["base"]["repo"] == {"name": "foo"}
Expand Down

0 comments on commit 9483ae9

Please sign in to comment.