Skip to content

Commit 1ff6134

Browse files
committed
Fix all ruff errors
1 parent d1172b9 commit 1ff6134

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

firefly/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# Firefly API client package
22
from .client import FireflyClient
33
from .exceptions import FireflyAPIError, FireflyAuthError
4+
5+
__all__ = [
6+
"FireflyClient",
7+
"FireflyAPIError",
8+
"FireflyAuthError",
9+
]

firefly/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,5 @@ def generate_image(
137137
contentClass=resp_json.get("contentClass"),
138138
_response=resp,
139139
)
140-
except (KeyError, IndexError, TypeError) as e:
140+
except (KeyError, IndexError, TypeError):
141141
raise FireflyAPIError(f"Unexpected response format: {resp}")

tests/test_cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import shutil
32
import tempfile
43
import pytest
54
from typer.testing import CliRunner
@@ -48,7 +47,7 @@ def test_generate_download_image(monkeypatch):
4847
with open(os.path.join(os.path.dirname(__file__), "images", "cat-coding.png"), "rb") as f:
4948
expected = f.read()
5049
assert content == expected
51-
assert f"Downloaded image (" in result.output
50+
assert "Downloaded image (" in result.output
5251

5352
@mock.patch("subprocess.run")
5453
def test_generate_show_images(mock_run):

tests/test_models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
from firefly.models import FireflyImageSize, FireflyImage, FireflyImageOutput, FireflyImageResponse
32
from unittest.mock import Mock
43

@@ -45,4 +44,4 @@ def test_firefly_image_response_content_class():
4544
img = FireflyImage(url="http://example.com/image.png")
4645
output = FireflyImageOutput(seed=2, image=img)
4746
resp = FireflyImageResponse(size=size, outputs=[output], contentClass="test-class")
48-
assert resp.contentClass == "test-class"
47+
assert resp.contentClass == "test-class"

0 commit comments

Comments
 (0)