Skip to content

Commit

Permalink
Don't use private Harness names.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Apr 3, 2024
1 parent 0c426cc commit 5d5ca86
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def bundle_handler(args: ops.testing.ExecArgs) -> None:
nonlocal expected_exec_call_was_made
expected_exec_call_was_made = True
if (
args.environment != harness._charm._create_discourse_environment_settings()
args.environment != harness.charm._create_discourse_environment_settings()
or args.working_dir != DISCOURSE_PATH
or args.user != "_daemon_"
):
Expand All @@ -189,7 +189,7 @@ def bundle_handler(args: ops.testing.ExecArgs) -> None:
harness.container_pebble_ready(SERVICE_NAME)
harness.framework.reemit()

assert harness._charm
assert harness.charm
assert expected_exec_call_was_made

updated_plan = harness.get_container_pebble_plan(SERVICE_NAME).to_dict()
Expand Down Expand Up @@ -327,7 +327,7 @@ def bundle_handler(args: ops.testing.ExecArgs) -> None:
nonlocal expected_exec_call_was_made
expected_exec_call_was_made = True
if (
args.environment != harness._charm._create_discourse_environment_settings()
args.environment != harness.charm._create_discourse_environment_settings()
or args.working_dir != DISCOURSE_PATH
or args.user != "_daemon_"
or args.stdin != f"{email}\n{password}\n{password}\nY\n"
Expand Down Expand Up @@ -371,7 +371,7 @@ def bundle_handler(args: ops.testing.ExecArgs) -> None:
nonlocal expected_exec_call_was_made
expected_exec_call_was_made = True
if (
args.environment != harness._charm._create_discourse_environment_settings()
args.environment != harness.charm._create_discourse_environment_settings()
or args.working_dir != DISCOURSE_PATH
or args.user != "_daemon_"
):
Expand Down Expand Up @@ -449,7 +449,7 @@ def exec_handler(args: ops.testing.ExecArgs) -> None:
expected_exec_call_was_made[" ".join(args.command)] = True

if (
args.environment != harness._charm._create_discourse_environment_settings()
args.environment != harness.charm._create_discourse_environment_settings()
or args.working_dir != DISCOURSE_PATH
or args.user != "_daemon_"
):
Expand Down Expand Up @@ -492,7 +492,7 @@ def exec_handler(args: ops.testing.ExecArgs) -> None:
expected_exec_call_was_made[" ".join(args.command)] = True

if (
args.environment != harness._charm._create_discourse_environment_settings()
args.environment != harness.charm._create_discourse_environment_settings()
or args.working_dir != DISCOURSE_PATH
or args.user != "_daemon_"
):
Expand Down Expand Up @@ -627,7 +627,7 @@ def test_http_proxy_env(monkeypatch):
"""
harness = helpers.start_harness()

created_env = harness._charm._create_discourse_environment_settings()
created_env = harness.charm._create_discourse_environment_settings()
assert created_env["HTTP_PROXY"] == ""
assert created_env["http_proxy"] == ""
assert created_env["HTTPS_PROXY"] == ""
Expand All @@ -638,7 +638,7 @@ def test_http_proxy_env(monkeypatch):
monkeypatch.setenv("JUJU_CHARM_HTTP_PROXY", "http://proxy.test")
monkeypatch.setenv("JUJU_CHARM_HTTPS_PROXY", "http://httpsproxy.test")
monkeypatch.setenv("JUJU_CHARM_NO_PROXY", "noproxy.test")
created_env = harness._charm._create_discourse_environment_settings()
created_env = harness.charm._create_discourse_environment_settings()

assert created_env["HTTP_PROXY"] == "http://proxy.test"
assert created_env["http_proxy"] == "http://proxy.test"
Expand Down

0 comments on commit 5d5ca86

Please sign in to comment.