Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Stratos Nikoloutsos committed Mar 12, 2024
1 parent 622e61e commit 4ab5a94
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
13 changes: 7 additions & 6 deletions src/pysdmx/fmr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Retrieve metadata from an FMR instance."""

from enum import Enum
from typing import (
Any,
Expand Down Expand Up @@ -223,9 +224,9 @@ def __fetch(self, url: str, is_ref_meta: bool = False) -> bytes:
try:
if is_ref_meta and self.format == Format.SDMX_JSON:
h = self.headers.copy()
h[
"Accept"
] = "application/vnd.sdmx.metadata+json;version=2.0.0"
h["Accept"] = (
"application/vnd.sdmx.metadata+json;version=2.0.0"
)
else:
h = self.headers
r = client.get(url, headers=h)
Expand Down Expand Up @@ -555,9 +556,9 @@ async def __fetch(self, url: str, is_ref_meta: bool = False) -> bytes:
try:
if is_ref_meta and self.format == Format.SDMX_JSON:
h = self.headers.copy()
h[
"Accept"
] = "application/vnd.sdmx.metadata+json;version=2.0.0"
h["Accept"] = (
"application/vnd.sdmx.metadata+json;version=2.0.0"
)
else:
h = self.headers
r = await client.get(url, headers=h)
Expand Down
1 change: 1 addition & 0 deletions src/pysdmx/fmr/fusion/dsd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of Fusion-JSON schemas for SDMX-REST schema queries."""

from typing import Dict, List, Optional, Sequence, Tuple

from msgspec import Struct
Expand Down
1 change: 1 addition & 0 deletions src/pysdmx/fmr/fusion/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of Fusion-JSON schemas for SDMX-REST schema queries."""

from typing import List, Sequence

import msgspec
Expand Down
1 change: 1 addition & 0 deletions src/pysdmx/fmr/sdmx/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of SDMX-JSON schemas for SDMX-REST schema queries."""

from typing import Sequence

import msgspec
Expand Down
4 changes: 1 addition & 3 deletions src/pysdmx/model/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,7 @@ def __len__(self) -> int:
"""Return the number of mapping rules in the structure map."""
return len(self.maps)

def __getitem__(
self, id_: str
) -> Optional[
def __getitem__(self, id_: str) -> Optional[
Sequence[
Union[
ComponentMap,
Expand Down
10 changes: 9 additions & 1 deletion tests/fmr/fusion/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,15 @@ async def test_codes_pra(
no_hca_pra_body,
)


@pytest.mark.asyncio()
async def test_core_local_repr_async(
respx_mock, async_fmr, no_const_query, no_hca_query, no_const_body, no_hca_body
respx_mock,
async_fmr,
no_const_query,
no_hca_query,
no_const_body,
no_hca_body,
):
"""Components have the expected representation (local or core)."""
await checks.check_core_local_repr_async(
Expand All @@ -258,6 +264,7 @@ async def test_core_local_repr_async(
no_hca_body,
)


def test_codes_no_const(
respx_mock, fmr, no_const_query, no_hca_query, no_const_body, no_hca_body
):
Expand All @@ -271,6 +278,7 @@ def test_codes_no_const(
no_hca_body,
)


def test_core_local_repr(
respx_mock, fmr, no_const_query, no_hca_query, no_const_body, no_hca_body
):
Expand Down
1 change: 0 additions & 1 deletion tests/fmr/schema_checks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
from datetime import datetime

import httpx
Expand Down

0 comments on commit 4ab5a94

Please sign in to comment.