Skip to content
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

[3.2] force the plugin_http_api_test to use a custom config dir #650

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/plugin_http_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PluginHttpTest(unittest.TestCase):
node_id = 1
nodeos = Node(TestHelper.LOCAL_HOST, TestHelper.DEFAULT_PORT, node_id, walletMgr=keosd)
data_dir = Utils.getNodeDataDir(node_id)
config_dir = Utils.getNodeConfigDir(node_id)
http_post_str = " -X POST -d "
http_post_invalid_param = " '{invalid}' "
empty_content_str = " ' { } ' "
Expand All @@ -31,13 +32,21 @@ def createDataDir(self):
shutil.rmtree(self.data_dir)
os.makedirs(self.data_dir)

# kill nodeos and keosd and clean up dir
# make a fresh config dir
def createConfigDir(self):
if os.path.exists(self.config_dir):
shutil.rmtree(self.config_dir)
os.makedirs(self.config_dir)
heifner marked this conversation as resolved.
Show resolved Hide resolved

# kill nodeos and keosd and clean up dirs
def cleanEnv(self) :
self.keosd.killall(True)
WalletMgr.cleanup()
Node.killAllNodeos()
if os.path.exists(self.data_dir):
shutil.rmtree(self.data_dir)
if os.path.exists(self.config_dir):
shutil.rmtree(self.config_dir)
time.sleep(self.sleep_s)

# start keosd and nodeos
Expand Down