Skip to content

Commit

Permalink
Merge pull request #142 from chipaca/fix-141
Browse files Browse the repository at this point in the history
fix the action generated by 'charmcraft init'
  • Loading branch information
chipaca authored Aug 27, 2020
2 parents 536ec91 + 5b8f0bf commit da102fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions charmcraft/templates/init/src/charm.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class {{ class_name }}(CharmBase):
if fail:
event.fail(fail)
else:
event.set_result(
"Probability is too important to be left to the experts."
" -- Richard Hamming")
event.set_results({"fortune": "A bug in the code is worth two in the documentation."})


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion charmcraft/templates/init/tests/test_charm.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestCharm(unittest.TestCase):
action_event = Mock(params={"fail": ""})
harness.charm._on_fortune_action(action_event)

self.assertTrue(action_event.set_result.called)
self.assertTrue(action_event.set_results.called)

def test_action_fail(self):
harness = Harness({{ class_name }})
Expand Down

0 comments on commit da102fc

Please sign in to comment.