Skip to content

Commit

Permalink
Chore: Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogaday authored and seldondev committed Apr 28, 2020
1 parent 151d27d commit c90ed4b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions python/seldon_core/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def split_image_tag(tag: str) -> Tuple[str]:
-------
Image name, image version tuple
"""
*name_parts, version = tag.split(':')
return ':'.join(name_parts), version
*name_parts, version = tag.split(":")
return ":".join(name_parts), version


# Development placeholder
Expand Down
12 changes: 3 additions & 9 deletions python/tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ def test_validate_model_metadata():
"inputs": [{"name": "input", "datatype": "BYTES", "shape": [1]}],
"outputs": [{"name": "output", "datatype": "BYTES", "shape": [1]}],
}
with patch(
'seldon_core.metadata.MODEL_IMAGE', None
):
with patch("seldon_core.metadata.MODEL_IMAGE", None):
assert meta == validate_model_metadata(meta)


Expand All @@ -112,9 +110,7 @@ def test_validate_model_metadata_with_env():
"inputs": [{"name": "input", "datatype": "BYTES", "shape": [1]}],
"outputs": [{"name": "output", "datatype": "BYTES", "shape": [1]}],
}
with patch(
'seldon_core.metadata.MODEL_IMAGE', 'seldonio/sklearn-iris:0.1'
):
with patch("seldon_core.metadata.MODEL_IMAGE", "seldonio/sklearn-iris:0.1"):
assert meta == validate_model_metadata(meta)


Expand All @@ -126,9 +122,7 @@ def test_validate_model_metadata_with_colon_in_env():
"inputs": [{"name": "input", "datatype": "BYTES", "shape": [1]}],
"outputs": [{"name": "output", "datatype": "BYTES", "shape": [1]}],
}
with patch(
'seldon_core.metadata.MODEL_IMAGE', 'localhost:32000/sklearn-iris:0.1'
):
with patch("seldon_core.metadata.MODEL_IMAGE", "localhost:32000/sklearn-iris:0.1"):
assert meta == validate_model_metadata(meta)


Expand Down
12 changes: 6 additions & 6 deletions python/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@


def test_split_image_tag():
image = 'seldonio/sklearn-iris:0.1'
expected_name = 'seldonio/sklearn-iris'
expected_version = '0.1'
image = "seldonio/sklearn-iris:0.1"
expected_name = "seldonio/sklearn-iris"
expected_version = "0.1"
name, version = split_image_tag(image)
assert name == expected_name
assert version == expected_version


def test_split_image_tag_with_colon():
image = 'localhost:32000/sklearn-iris:0.1'
expected_name = 'localhost:32000/sklearn-iris'
expected_version = '0.1'
image = "localhost:32000/sklearn-iris:0.1"
expected_name = "localhost:32000/sklearn-iris"
expected_version = "0.1"
name, version = split_image_tag(image)
assert name == expected_name
assert version == expected_version
Expand Down

0 comments on commit c90ed4b

Please sign in to comment.