MCPcopy Create free account
hub / github.com/tiny-pilot/tinypilot / setUp

Method setUp

app/update/settings_test.py:11–25  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9class UpdateSettingsTest(unittest.TestCase):
10
11 def setUp(self):
12 # Mock out the path to the settings.yml file so that it points to a file
13 # path that the test controls.
14
15 # Ignore pylint because we perform a tear down and assert the temporary
16 # files are gone.
17 # pylint: disable=consider-using-with
18 self.mock_settings_dir = tempfile.TemporaryDirectory()
19 self.settings_file_path = os.path.join(self.mock_settings_dir.name,
20 'settings.yml')
21
22 path_patch = mock.patch.object(update.settings, '_SETTINGS_FILE_PATH',
23 self.settings_file_path)
24 self.addCleanup(path_patch.stop)
25 path_patch.start()
26
27 def tearDown(self):
28 self.mock_settings_dir.cleanup()

Callers

nothing calls this directly

Calls 1

startMethod · 0.80

Tested by

no test coverage detected