Skip to content

Commit 8a1bef3

Browse files
committed
Run isort, fix unit test
1 parent d7e4b34 commit 8a1bef3

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

openapi_python_client/parser/properties/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from itertools import chain
2-
from typing import Any, ClassVar, Dict, Generic, Iterable, List, Optional, Set, Tuple, TypeVar, Union, Iterator
2+
from typing import Any, ClassVar, Dict, Generic, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar, Union
33

44
import attr
55

6+
from ... import schema as oai
7+
from ... import utils
8+
from ..errors import PropertyError, ValidationError
9+
from ..reference import Reference
610
from .converter import convert, convert_chain
711
from .enum_property import EnumProperty
812
from .model_property import ModelProperty
913
from .property import Property
1014
from .schemas import Schemas
11-
from ..errors import PropertyError, ValidationError
12-
from ..reference import Reference
13-
from ... import schema as oai
14-
from ... import utils
1515

1616

1717
@attr.s(auto_attribs=True, frozen=True)

tests/test_parser/test_properties/test_init.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def test_get_type_string(self, mocker):
292292
assert p.get_type_string() == base_type_string_with_unset
293293
assert p.get_type_string(no_optional=True) == base_type_string
294294

295-
def test_get_type_imports(self, mocker):
295+
def test_get_imports(self, mocker):
296296
from openapi_python_client.parser.properties import UnionProperty
297297

298298
inner_property_1 = mocker.MagicMock()
@@ -313,7 +313,7 @@ def test_get_type_imports(self, mocker):
313313
assert p.get_imports(prefix=prefix) == {
314314
inner_import_1,
315315
inner_import_2,
316-
"from typing import Union",
316+
"from typing import cast, Union",
317317
}
318318

319319
p = UnionProperty(
@@ -327,6 +327,7 @@ def test_get_type_imports(self, mocker):
327327
inner_import_1,
328328
inner_import_2,
329329
"from typing import Union",
330+
"from typing import cast, Union",
330331
"from ...types import UNSET, Unset",
331332
}
332333

@@ -341,6 +342,7 @@ def test_get_type_imports(self, mocker):
341342
inner_import_1,
342343
inner_import_2,
343344
"from typing import Union",
345+
"from typing import cast, Union",
344346
"from typing import Optional",
345347
"from ...types import UNSET, Unset",
346348
}

0 commit comments

Comments
 (0)