Skip to content

Commit

Permalink
fix tests related to package path changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodong-Yang committed May 30, 2024
1 parent 247f2bc commit ec65687
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TestConfiguration:
OTACLIENT_STUB_MODULE_PATH = "otaclient.app.ota_client_stub"
OTACLIENT_SERVICE_MODULE_PATH = "otaclient.app.ota_client_service"
OTAMETA_MODULE_PATH = "otaclient.app.ota_metadata"
OTAPROXY_MODULE_PATH = "otaclient.ota_proxy"
OTAPROXY_MODULE_PATH = "ota_proxy"
CREATE_STANDBY_MODULE_PATH = "otaclient.app.create_standby"
MAIN_MODULE_PATH = "otaclient.app.main"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_ota_client_stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
from otaclient.app.proto import wrapper
from otaclient.configs.ecu_info import ECUInfo, parse_ecu_info
from otaclient.configs.proxy_info import ProxyInfo, parse_proxy_info
from otaclient.ota_proxy import OTAProxyContextProto
from otaclient.ota_proxy.config import Config as otaproxyConfig
from ota_proxy import OTAProxyContextProto
from ota_proxy.config import Config as otaproxyConfig
from tests.conftest import cfg
from tests.utils import compare_message

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ota_proxy/test_cache_control_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import pytest

from otaclient.ota_proxy import OTAFileCacheControl
from ota_proxy import OTAFileCacheControl


@pytest.mark.parametrize(
Expand Down
10 changes: 5 additions & 5 deletions tests/test_ota_proxy/test_cachedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@

import pytest

from otaclient.ota_proxy import config as cfg
from otaclient.ota_proxy.orm import NULL_TYPE
from otaclient.ota_proxy.ota_cache import CacheMeta, OTACacheDB
from otaclient.ota_proxy.utils import url_based_hash
from ota_proxy import config as cfg
from ota_proxy.orm import NULL_TYPE
from ota_proxy.ota_cache import CacheMeta, OTACacheDB
from ota_proxy.utils import url_based_hash

logger = logging.getLogger(__name__)


class TestORM:
@pytest.fixture(autouse=True)
def create_table_defs(self):
from otaclient.ota_proxy.orm import NULL_TYPE, ColumnDescriptor, ORMBase
from ota_proxy.orm import NULL_TYPE, ColumnDescriptor, ORMBase

@dataclass
class TableCls(ORMBase):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ota_proxy/test_ota_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import pytest

from otaclient.ota_proxy import config as cfg
from otaclient.ota_proxy.db import CacheMeta, OTACacheDB
from otaclient.ota_proxy.ota_cache import CachingRegister, LRUCacheHelper
from otaclient.ota_proxy.utils import url_based_hash
from ota_proxy import config as cfg
from ota_proxy.db import CacheMeta, OTACacheDB
from ota_proxy.ota_cache import CachingRegister, LRUCacheHelper
from ota_proxy.utils import url_based_hash

logger = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_ota_proxy/test_ota_proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from otaclient.app.ota_metadata import parse_regulars_from_txt
from otaclient.app.proto.wrapper import RegularInf
from otaclient.ota_proxy.utils import url_based_hash
from ota_proxy.utils import url_based_hash
from tests.conftest import ThreadpoolExecutorFixtureMixin, cfg

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -71,7 +71,7 @@ class TestOTAProxyServer(ThreadpoolExecutorFixtureMixin):
async def setup_ota_proxy_server(self, tmp_path: Path, request):
import uvicorn

from otaclient.ota_proxy import App, OTACache
from ota_proxy import App, OTACache

ota_cache_dir = tmp_path / "ota-cache"
ota_cache_dir.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -173,7 +173,7 @@ async def test_download_file_with_special_fname(self):
"""
import sqlite3

from otaclient.ota_proxy import config as cfg
from ota_proxy import config as cfg

# ------ get the special file via otaproxy from the ota image server ------ #
# --- execution --- #
Expand Down Expand Up @@ -295,7 +295,7 @@ class TestOTAProxyServerWithoutCache(ThreadpoolExecutorFixtureMixin):
async def setup_ota_proxy_server(self, tmp_path: Path):
import uvicorn

from otaclient.ota_proxy import App, OTACache
from ota_proxy import App, OTACache

ota_cache_dir = tmp_path / "ota-cache"
ota_cache_dir.mkdir(parents=True, exist_ok=True)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_ota_proxy/test_subprocess_launch_otaproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@


import time
from functools import partial
from pathlib import Path
from typing import Any, Dict

from otaclient.ota_proxy import OTAProxyContextProto, subprocess_otaproxy_launcher
from ota_proxy import OTAProxyContextProto, subprocess_otaproxy_launcher


class _DummyOTAProxyContext(OTAProxyContextProto):
Expand Down

0 comments on commit ec65687

Please sign in to comment.