Skip to content

Commit 6e2b6fa

Browse files
authored
Chore/format unit test output (#2)
* Formatted unit tests output * Updated the styling of README
1 parent 42f53ae commit 6e2b6fa

File tree

7 files changed

+27
-3
lines changed

7 files changed

+27
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Scientific Computing with Python - freeCodeCamp
1+
# Scientific Computing with Python
22

33
## About the Projects
44
This repository contains my solutions to the projects in "Scientific Computing with Python" course from freeCodeCamp.

arithmetic_formatter/test_formatter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77

88
class UnitTests(unittest.TestCase):
9+
@classmethod
10+
def setUpClass(cls) -> None:
11+
test_name = "Arithmetic Formatter Tests"
12+
print(f"\n{test_name}\n{'=' * len(test_name)}")
913

1014
@parameterized.expand([
1115
param(name="test_two_problems_arrangement1",
@@ -60,7 +64,7 @@ class UnitTests(unittest.TestCase):
6064
msg='Expected solutions to be correctly displayed in output when calling "arithmetic_arranger()" with '
6165
'five arithmetic problems and a second argument of `True`.')
6266
])
63-
def test_arithmetic_formatter(self, name: str, args: List[Union[List[str], Optional[bool]]], expected: str,
67+
def test_arithmetic_formatter(self, name, args: List[Union[List[str], Optional[bool]]], expected: str,
6468
msg: str):
6569
actual: str = formatter(*args)
6670
self.assertEqual(actual, expected, msg)

budget_app/test_budget.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
class UnitTests(unittest.TestCase):
77
maxDiff = None
88

9+
@classmethod
10+
def setUpClass(cls) -> None:
11+
test_name = "Budget App Tests"
12+
print(f"\n{test_name}\n{'=' * len(test_name)}")
13+
914
def setUp(self):
1015
self.food = Category("Food")
1116
self.entertainment = Category("Entertainment")

polygon_area_calculator/test_polygon_area_calc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
class UnitTests(unittest.TestCase):
77
maxDiff = None
88

9+
@classmethod
10+
def setUpClass(cls) -> None:
11+
test_name = "Polygon Area Tests"
12+
print(f"\n{test_name}\n{'=' * len(test_name)}")
13+
914
def setUp(self):
1015
self.rect = Rectangle(3, 6)
1116
self.sq = Square(5)

probability_calculator/test_prob_calc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
class UnitTests(unittest.TestCase):
77
maxDiff = None
88

9+
@classmethod
10+
def setUpClass(cls) -> None:
11+
test_name = "Probability Calculator Tests"
12+
print(f"\n{test_name}\n{'=' * len(test_name)}")
13+
914
def test_hat_class_contents(self):
1015
hat = Hat(red=3, blue=2)
1116
actual = hat.contents

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "python-projects"
33
version = "1.0.0"
4-
description = ""
4+
description = "Python projects made for the freeCodeCamp Scientific Computing with Python Certification."
55
authors = ["mrarvind90 <[email protected]>"]
66
readme = "README.md"
77

time_calculator/test_time_calc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
class UnitTests(unittest.TestCase):
77
maxDiff = None
88

9+
@classmethod
10+
def setUpClass(cls) -> None:
11+
test_name = "Time Calculator Tests"
12+
print(f"\n{test_name}\n{'=' * len(test_name)}")
13+
914
def test_same_period(self):
1015
actual = add_time("3:30 PM", "2:12")
1116
expected = "5:42 PM"

0 commit comments

Comments
 (0)