Skip to content

Commit

Permalink
assert exit status based on the generated updates
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and ekohl committed Nov 29, 2024
1 parent 215cb42 commit 946e7ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/unit/salt_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ def test_capture_jid
def test_override_exit_status
runner = SaltRunner.new({}, :suspended_action => nil)
assert_nil runner.jid
assert_equal 1, runner.publish_exit_status(0)
runner.publish_exit_status(0)
updates = runner.generate_updates
assert_equal 1, updates[{:suspended_action => nil}].exit_status
runner.publish_data('jid: 12345', 'stdout')
assert_equal 0, runner.publish_exit_status(0)
runner.publish_exit_status(0)
updates = runner.generate_updates
assert_equal 0, updates[{:suspended_action => nil}].exit_status
end

def test_generate_command
Expand Down

0 comments on commit 946e7ee

Please sign in to comment.