Skip to content

Commit

Permalink
Fix tests after removing single-call wrapper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Mar 21, 2024
1 parent a04247a commit 0007bfa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self,


@patch('ops.main.setup_root_logging', new=lambda *a, **kw: None) # type: ignore
@patch('ops.main._Manager._emit_charm_event', new=lambda *a, **kw: None) # type: ignore
@patch('ops.main._emit_charm_event', new=lambda *a, **kw: None) # type: ignore
@patch('ops.charm._evaluate_status', new=lambda *a, **kw: None) # type: ignore
class CharmInitTestCase(unittest.TestCase):

Expand Down Expand Up @@ -226,13 +226,13 @@ def __init__(self, framework: ops.Framework):
dispatch.chmod(0o755)

with patch.dict(os.environ, fake_environ):
with patch('ops.main._Manager._emit_charm_event') as mock_charm_event:
with patch('ops.main._emit_charm_event') as mock_charm_event:
with patch('ops.main._get_charm_dir') as mock_charmdir:
mock_charmdir.return_value = tmpdir
ops.main(MyCharm) # type: ignore

self.assertEqual(mock_charm_event.call_count, 1)
return mock_charm_event.call_args[0][0]
return mock_charm_event.call_args[0][1]

def test_most_legacy(self):
"""Without dispatch, sys.argv[0] is used."""
Expand Down

0 comments on commit 0007bfa

Please # to comment.