mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 08:17:13 +03:00
make tests not explode on windows
This commit is contained in:
parent
7bcf3a6f4d
commit
8c2a0ae95a
@ -3,7 +3,7 @@ import os
|
|||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
from typing import List, Optional, Union
|
from typing import TYPE_CHECKING, List, Optional, Union
|
||||||
|
|
||||||
from config import AbstractConfig, appname, logger
|
from config import AbstractConfig, appname, logger
|
||||||
|
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
"""Test the config system."""
|
"""
|
||||||
|
Test the config system.
|
||||||
|
|
||||||
|
Note: These tests to arbitrary reads and writes to an existing config, including
|
||||||
|
key deletions. Said modifications are to keys that are generated internally.
|
||||||
|
|
||||||
|
Most of these tests are parity tests with the "old" config, and likely one day can be
|
||||||
|
entirely removed.
|
||||||
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
@ -19,7 +27,7 @@ print(sys.path)
|
|||||||
|
|
||||||
from _old_config import old_config # noqa: E402
|
from _old_config import old_config # noqa: E402
|
||||||
|
|
||||||
from config import LinuxConfig, config # noqa: E402
|
from config import config # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
def _fuzz_list(length: int) -> List[str]:
|
def _fuzz_list(length: int) -> List[str]:
|
||||||
@ -77,6 +85,11 @@ class TestNewConfig:
|
|||||||
|
|
||||||
def __update_linuxconfig(self) -> None:
|
def __update_linuxconfig(self) -> None:
|
||||||
"""On linux config uses ConfigParser, which doesn't update from disk changes. Force the update here."""
|
"""On linux config uses ConfigParser, which doesn't update from disk changes. Force the update here."""
|
||||||
|
if sys.platform != 'linux':
|
||||||
|
return
|
||||||
|
|
||||||
|
from config.linux import LinuxConfig
|
||||||
|
|
||||||
if isinstance(config, LinuxConfig) and config.config is not None:
|
if isinstance(config, LinuxConfig) and config.config is not None:
|
||||||
config.config.read(config.filename)
|
config.config.read(config.filename)
|
||||||
|
|
||||||
@ -163,6 +176,10 @@ class TestOldNewConfig:
|
|||||||
|
|
||||||
def __update_linuxconfig(self) -> None:
|
def __update_linuxconfig(self) -> None:
|
||||||
"""On linux config uses ConfigParser, which doesn't update from disk changes. Force the update here."""
|
"""On linux config uses ConfigParser, which doesn't update from disk changes. Force the update here."""
|
||||||
|
if sys.platform != 'linux':
|
||||||
|
return
|
||||||
|
|
||||||
|
from config.linux import LinuxConfig
|
||||||
if isinstance(config, LinuxConfig) and config.config is not None:
|
if isinstance(config, LinuxConfig) and config.config is not None:
|
||||||
config.config.read(config.filename)
|
config.config.read(config.filename)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user