Skip to content

Commit 029cec2

Browse files
committed
Several changes to mediator.py
1) Fixed several methods whose parameters were not being used (setTm in TC, Reporter, and DB), and places where class members were being assigned the value of global variables. 2) Moved an import to the top of the file, as suggested in pep8 (http://www.python.org/dev/peps/pep-0008/#imports). 3) Removed an unused local variable in TestManager's publishReport method.
1 parent da97203 commit 029cec2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mediator.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"""http://dpip.testingperspective.com/?p=28"""
22

3+
import random
34
import time
45

56

67
class TC:
78
def __init__(self):
8-
self._tm = tm
9+
self._tm = None
910
self._bProblem = 0
1011

1112
def setup(self):
@@ -28,7 +29,7 @@ def tearDown(self):
2829
else:
2930
print("Test not executed. No tear down required.")
3031

31-
def setTM(self, TM):
32+
def setTM(self, tm):
3233
self._tm = tm
3334

3435
def setProblem(self, value):
@@ -47,7 +48,7 @@ def report(self):
4748
print("Reporting the results of Test")
4849
time.sleep(1)
4950

50-
def setTM(self, TM):
51+
def setTM(self, tm):
5152
self._tm = tm
5253

5354

@@ -67,7 +68,7 @@ def update(self):
6768
print("Updating the test results in Database")
6869
time.sleep(1)
6970

70-
def setTM(self, TM):
71+
def setTM(self, tm):
7172
self._tm = tm
7273

7374

@@ -91,7 +92,7 @@ def setDB(self, db):
9192

9293
def publishReport(self):
9394
self._db.update()
94-
rvalue = self._reporter.report()
95+
self._reporter.report()
9596

9697
def setTC(self, tc):
9798
self._tc = tc

0 commit comments

Comments
 (0)