def test_show_state_usage(): """ Test to list out the state usage that will be applied to this minion """ mock = MagicMock(side_effect=["A", None, None]) with patch.object(state, "_check_queue", mock): assert state.show_state_usage() == "A" pytest.raises(SaltInvocationError, state.show_state_usage, pillar="A") assert state.show_state_usage() == "A"
def test_show_state_usage(self): ''' Test to list out the state usage that will be applied to this minion ''' mock = MagicMock(side_effect=["A", None, None]) with patch.object(state, '_check_queue', mock): self.assertEqual(state.show_state_usage(), "A") self.assertRaises(SaltInvocationError, state.show_state_usage, pillar="A") self.assertEqual(state.show_state_usage(), "A")