From 4f0300a0e6ed5e9ccbcc56a9a8a1d4134f796da7 Mon Sep 17 00:00:00 2001 From: LucasAndradeDias Date: Tue, 3 Oct 2023 12:06:20 -0300 Subject: [PATCH] Added given, when and then docstring for tests --- tests/test_trace.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_trace.py b/tests/test_trace.py index f82877f..948efca 100644 --- a/tests/test_trace.py +++ b/tests/test_trace.py @@ -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"])