mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
Bugfix: Mock persisted beyond intended test case
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
from unittest.mock import Mock
|
||||
from unittest.mock import patch
|
||||
|
||||
from base import BaseTest
|
||||
from seedsigner.models.settings_definition import SettingsConstants
|
||||
@@ -31,8 +31,7 @@ class TestSettingsDefinition(BaseTest):
|
||||
# We're going to mock the `root` results to include the absent language code's .mo file
|
||||
mocked_results = [(os.path.join(root, "en", "LC_MESSAGES"), [], ["messages.po", "messages.mo"])]
|
||||
mocked_results.append((os.path.join(root, absent_language_code, "LC_MESSAGES"), [], ["messages.po", "messages.mo"]))
|
||||
os.walk = Mock(return_value=mocked_results)
|
||||
|
||||
with patch("os.walk", return_value=mocked_results):
|
||||
# Recheck w/our mocked dir listing:
|
||||
detected_languages = [lang_tuple[0] for lang_tuple in SettingsConstants.get_detected_languages()]
|
||||
assert absent_language_code in detected_languages
|
||||
|
||||
Reference in New Issue
Block a user