Skip to content

Commit

Permalink
Sometimes Ruff's autofixes aren't correct
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Mar 27, 2024
1 parent efe3fe2 commit 7885e93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions test/cozy/model/test_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_offline_returns_default_value(peewee_database):
from cozy.db.book import Book as BookDB

book = Book(peewee_database, BookDB.get(1))
assert book.offline is False
assert not book.offline


def test_setting_offline_updates_in_book_object_and_database(peewee_database):
Expand All @@ -179,16 +179,16 @@ def test_setting_offline_updates_in_book_object_and_database(peewee_database):

book = Book(peewee_database, BookDB.get(1))
book.offline = True
assert book.offline is True
assert BookDB.get_by_id(1).offline is True
assert book.offline
assert BookDB.get_by_id(1).offline


def test_downloaded_returns_default_value(peewee_database):
from cozy.model.book import Book
from cozy.db.book import Book as BookDB

book = Book(peewee_database, BookDB.get(1))
assert book.downloaded is False
assert not book.downloaded


def test_setting_downloaded_updates_in_book_object_and_database(peewee_database):
Expand Down
2 changes: 1 addition & 1 deletion test/cozy/model/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_external_storage_locations_contain_only_external_storages(peewee_databa
from cozy.db.storage import Storage

settings = Settings()
storage_locations = Storage.select().where(Storage.external is True)
storage_locations = Storage.select().where(Storage.external)

assert len(settings.external_storage_locations) == len(storage_locations)
assert all(storage.external for storage in settings.external_storage_locations)
Expand Down
4 changes: 2 additions & 2 deletions test/cozy/model/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_default_returns_correct_default_value(peewee_database_storage):
from cozy.model.storage import Storage

storage = Storage(peewee_database_storage, 1)
assert storage.default is False
assert not storage.default


def test_setting_default_updates_in_track_object_and_database(peewee_database_storage):
Expand All @@ -72,7 +72,7 @@ def test_external_returns_correct_default_value(peewee_database_storage):
from cozy.model.storage import Storage

storage = Storage(peewee_database_storage, 1)
assert storage.external is False
assert not storage.external


def test_setting_external_updates_in_track_object_and_database(peewee_database_storage):
Expand Down

0 comments on commit 7885e93

Please sign in to comment.