Skip to content

Commit

Permalink
Less extreme code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
micknudsen committed Dec 1, 2023
1 parent 76be5de commit 9471b37
Showing 1 changed file with 7 additions and 44 deletions.
51 changes: 7 additions & 44 deletions 2015/02/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
)
Expand All @@ -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)

0 comments on commit 9471b37

Please sign in to comment.