style(wallpaper_changer): ruff auto fix

This commit is contained in:
Lucas Vivo committed 2026-11-20 15:58:04 +01:00
1 parent 79b3bdd91f
commit 1667362b9d
3 files changed
+9 -4

No files matched your search

@@ -105,7 +105,10 @@ class WallpaperBuilder:
stroke_fill="black", stroke_fill="black",
) )
images_used.append(image_record['name']) images_used.append(image_record['name'])
logger.info(f"Pasted image {image_record['name']} on monitor at x={monitor.x_coord}, width={monitor.width}, height={monitor.height}") logger.info(
f"Pasted image {image_record['name']} on monitor "
f"at x={monitor.x_coord}, width={monitor.width}, height={monitor.height}"
)
destination = ( destination = (
Path(output_path) Path(output_path)
@@ -74,7 +74,7 @@ class ImageRepositoryTests(unittest.TestCase):
all(image["file"].suffix == ".jpg_enc" for image in images) all(image["file"].suffix == ".jpg_enc" for image in images)
) )
self.assertTrue( self.assertTrue(
all(image["hash"] != None for image in images) all(image["hash"] is not None for image in images)
) )
self.assertTrue( self.assertTrue(
all(image["file"].parent.name == "corrupt" for image in images) all(image["file"].parent.name == "corrupt" for image in images)
@@ -220,7 +220,8 @@ class ImageRepositoryTests(unittest.TestCase):
self.assertEqual( sum(1 for image in images if image["file"].suffix == ".jpg"), 0) self.assertEqual( sum(1 for image in images if image["file"].suffix == ".jpg"), 0)
self.assertEqual( sum(1 for image in images if image["file"].suffix == ".jpg_enc"), 9) self.assertEqual( sum(1 for image in images if image["file"].suffix == ".jpg_enc"), 9)
self.assertTrue( image["name"] == "Foto_Berg05.jpg" for image in images if image["file"].name == "00009.jpg_enc") self.assertTrue( image["name"] == "Foto_Berg05.jpg"
for image in images if image["file"].name == "00009.jpg_enc")
def test_decode_all(self) -> None: def test_decode_all(self) -> None:
with TemporaryDirectory() as temporary_directory: with TemporaryDirectory() as temporary_directory:
@@ -360,7 +360,8 @@ class WallpaperBuilderEdgeCaseTests(unittest.TestCase):
"--private-key", str(assets / "test_private_key.pem")) "--private-key", str(assets / "test_private_key.pem"))
config = Config.load(args) config = Config.load(args)
(image_root / "Desktop1920x1080" ).mkdir() (image_root / "Desktop1920x1080" ).mkdir()
shutil.copy(assets / "Desktop1920x1080" / "Foto_Berg01.jpg", config.img_dir/"Foto_Berg01.jpg") shutil.copy(assets / "Desktop1920x1080" / "Foto_Berg01.jpg",
config.img_dir/"Foto_Berg01.jpg")
# Get file size # Get file size
size = os.path.getsize(config.img_dir/"Foto_Berg01.jpg") size = os.path.getsize(config.img_dir/"Foto_Berg01.jpg")
# Remove the last 50 bytes # Remove the last 50 bytes