-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
READY: Fix bugs with loading AttestationCommunity #119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import os | ||
import shutil | ||
import sys | ||
import threading | ||
import time | ||
|
@@ -49,10 +51,14 @@ def setUp(self): | |
self.__lockup_timestamp__ = time.time() | ||
|
||
def tearDown(self): | ||
super(TestBase, self).tearDown() | ||
for node in self.nodes: | ||
node.unload() | ||
internet.clear() | ||
try: | ||
super(TestBase, self).tearDown() | ||
for node in self.nodes: | ||
node.unload() | ||
internet.clear() | ||
finally: | ||
shutil.rmtree("temp", ignore_errors=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are not removing the directory created in the method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I missed that one! |
||
|
||
|
||
@classmethod | ||
def setUpClass(cls): | ||
|
@@ -128,3 +134,8 @@ def introduce_nodes(self): | |
for node in self.nodes: | ||
node.discovery.take_step() | ||
yield self.sleep() | ||
|
||
def temporary_directory(self): | ||
d = os.path.join("temp", self.__class__.__name__ + str(int(time.time()))) | ||
os.makedirs(d) | ||
return d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments: first, I think the naming of the variables should be more clear and precise. Second, I see two callbacks here but I have no idea what they are doing exactly. Could you use a named tuple or even a dictionary instead to store these callbacks by a human-readable key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enhancement, but as this is a general improvement and not required for this fix I have moved this to #121 .