From 9471b3715da4295f04172dcf939167a2f5133548 Mon Sep 17 00:00:00 2001 From: Michael Knudsen Date: Fri, 1 Dec 2023 08:03:46 +0100 Subject: [PATCH] Less extreme code formatting --- 2015/02/code.py | 51 +++++++------------------------------------------ 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/2015/02/code.py b/2015/02/code.py index 066d56f..93f917c 100644 --- a/2015/02/code.py +++ b/2015/02/code.py @@ -41,40 +41,12 @@ def ribbon_needed( class TestCode(unittest.TestCase): def test_paper_needed(self) -> None: - self.assertEqual( - paper_needed( - length=2, - width=3, - height=4, - ), - 58, - ) - self.assertEqual( - paper_needed( - length=1, - width=1, - height=10, - ), - 43, - ) + self.assertEqual(paper_needed(length=2, width=3, height=4), 58) + self.assertEqual(paper_needed(length=1, width=1, height=10), 43) def test_ribbon_needed(self) -> None: - self.assertEqual( - ribbon_needed( - length=2, - width=3, - height=4, - ), - 34, - ) - self.assertEqual( - ribbon_needed( - length=1, - width=1, - height=10, - ), - 14, - ) + self.assertEqual(ribbon_needed(length=2, width=3, height=4), 34) + self.assertEqual(ribbon_needed(length=1, width=1, height=10), 14) class TestPuzzle(unittest.TestCase): @@ -87,10 +59,7 @@ def setUp(self) -> None: with open("input.txt") as f: for dimension in f.read().splitlines(): - length, width, height = map( - int, - dimension.split("x"), - ) + length, width, height = map(int, dimension.split("x")) self.total_paper += paper_needed( length=length, width=width, height=height ) @@ -99,13 +68,7 @@ def setUp(self) -> None: ) def test_part_one(self) -> None: - self.assertEqual( - self.total_paper, - 1586300, - ) + self.assertEqual(self.total_paper, 1586300) def test_part_two(self) -> None: - self.assertEqual( - self.total_ribbon, - 3737498, - ) + self.assertEqual(self.total_ribbon, 3737498)