Skip to content

Commit

Permalink
remove request mock
Browse files Browse the repository at this point in the history
  • Loading branch information
matveyvarg committed Oct 16, 2023
1 parent d60504d commit 6e69ad7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_cases/test_factory.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from unittest.mock import patch
import re

from unittest.mock import patch

from deker.uri import Uri
from deker_local_adapters.storage_adapters.hdf5 import HDF5StorageAdapter

from tests.mocks import MockedAdaptersFactory

from deker_server_adapters.array_adapter import ServerArrayAdapter
from deker_server_adapters.collection_adapter import ServerCollectionAdapter
from deker_server_adapters.factory import AdaptersFactory
from deker_server_adapters.varray_adapter import ServerVarrayAdapter
import requests_mock
from tests.mocks import MockedAdaptersFactory


def test_get_server_array_adapter(adapter_factory: AdaptersFactory, collection_path: Uri):
assert isinstance(
Expand Down Expand Up @@ -44,9 +46,9 @@ def test_auth_factory_close(ctx):

def test_ctx_has_values_from_server(ctx, httpx_mock):
uri = Uri.create("http://test:test@localhost/")
servers = ['http://localhost:8031']
servers = ["http://localhost:8031"]

httpx_mock.add_response(method='get', url=re.compile(r'.*\/v1\/ping'), json={'servers': servers})
httpx_mock.add_response(method="get", url=re.compile(r".*\/v1\/ping"), json={"servers": servers})
factory = AdaptersFactory(ctx, uri)
vadapter = factory.get_varray_adapter("/col", HDF5StorageAdapter)
adapter = factory.get_array_adapter("/coll", HDF5StorageAdapter)
Expand Down

0 comments on commit 6e69ad7

Please sign in to comment.