def test_run(self): patch_dict = { 'snapper.create_snapshot': MagicMock(return_value=43), 'test.ping': MagicMock(return_value=True), } with patch.dict(snapper.__salt__, patch_dict): self.assertEqual(snapper.run("test.ping"), True) self.assertRaises(CommandExecutionError, snapper.run, "unknown.func")
def test_run(self): patch_dict = { 'snapper.create_snapshot': MagicMock(return_value=43), 'test.ping': MagicMock(return_value=True), } with patch.dict(snapper.__salt__, patch_dict): self.assertEqual(snapper.run("test.ping"), True) self.assertRaises(CommandExecutionError, snapper.run, "unknown.func")