Skip to content

Commit

Permalink
Added given, when and then docstring for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasAndradeDias committed Oct 3, 2023
1 parent ca0c271 commit 4f0300a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ def tearDown(self):
self.parser.functions_flow = collections.OrderedDict()

def test_run_positive_input(self):
"""
Given a valid module path and a callable function "test",
When Trace.run is called with these parameters,
Then it should trace the function and produce the expected trace result.
"""
module_path = self.mock_path + "/module_testing_1.py"
self.parser.run(module_path, "test")
expected_trace = r"Trace object\nrunned objects:\n __init__ + \n func1 + \n func2 + \n "
self.assertEqual(expected_trace, repr(self.parser))

def test_run_positive_input_with_parameters(self):
"""
Given a valid module path, a callable function "numberToIp",
and function parameters ["000"],
When Trace.run is called with these parameters,
Then it should trace the function and produce the expected trace result.
"""
module_path = self.mock_path + "/module_testing_2.py"
self.parser.run(module_path, "numberToIp", ["000"])

Expand Down

0 comments on commit 4f0300a

Please sign in to comment.