From 6c27d656f2821a583b231eddc05b34a2db54a0e0 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Wed, 25 Oct 2023 15:34:23 -0700 Subject: [PATCH] tests: add shared mocks and remove bad import This commit re-adds some of the shared mock fields for testing and removes a bad import from test_snaplist. These are changes that shouldn't have been part of the previously reverted patch: 0a70a969d42a29d2585d2b1433017217338b762f --- subiquity/server/controllers/tests/test_snaplist.py | 2 +- subiquitycore/tests/mocks.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/subiquity/server/controllers/tests/test_snaplist.py b/subiquity/server/controllers/tests/test_snaplist.py index 78f2af49..ba12aed7 100644 --- a/subiquity/server/controllers/tests/test_snaplist.py +++ b/subiquity/server/controllers/tests/test_snaplist.py @@ -14,7 +14,7 @@ # along with this program. If not, see . import unittest -from unittest.mock import AsyncMock, Mock +from unittest.mock import AsyncMock import requests diff --git a/subiquitycore/tests/mocks.py b/subiquitycore/tests/mocks.py index 74f2f66b..663b02b8 100644 --- a/subiquitycore/tests/mocks.py +++ b/subiquitycore/tests/mocks.py @@ -43,4 +43,9 @@ def make_app(model=None): app.opts = mock.Mock() app.opts.dry_run = True app.scale_factor = 1000 + app.echo_syslog_id = None + app.log_syslog_id = None + app.report_start_event = mock.Mock() + app.report_finish_event = mock.Mock() + return app