tests: Update test_prepare.

This commit is contained in:
tecnovert
2025-03-19 18:31:24 +02:00
parent ec31f2eb35
commit 082a7f3d44

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (c) 2019-2024 tecnovert # Copyright (c) 2019-2024 tecnovert
# Copyright (c) 2024 The Basicswap developers # Copyright (c) 2024-2025 The Basicswap developers
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php. # file LICENSE or http://www.opensource.org/licenses/mit-license.php.
@@ -109,42 +109,42 @@ class Test(unittest.TestCase):
testargs = [ testargs = [
"basicswap-prepare", "basicswap-prepare",
"-datadir=" + test_path_plain, "-datadir=" + test_path_plain,
"-addcoin=namecoin", "-addcoin=bitcoin",
] ]
with patch.object(sys, "argv", testargs): with patch.object(sys, "argv", testargs):
prepareSystem.main() prepareSystem.main()
with open(config_path) as fs: with open(config_path) as fs:
settings = json.load(fs) settings = json.load(fs)
self.assertTrue( self.assertTrue(
settings["chainclients"]["namecoin"]["connection_type"] == "rpc" settings["chainclients"]["bitcoin"]["connection_type"] == "rpc"
) )
logger.info("Test disablecoin") logger.info("Test disablecoin")
testargs = [ testargs = [
"basicswap-prepare", "basicswap-prepare",
"-datadir=" + test_path_plain, "-datadir=" + test_path_plain,
"-disablecoin=namecoin", "-disablecoin=bitcoin",
] ]
with patch.object(sys, "argv", testargs): with patch.object(sys, "argv", testargs):
prepareSystem.main() prepareSystem.main()
with open(config_path) as fs: with open(config_path) as fs:
settings = json.load(fs) settings = json.load(fs)
self.assertTrue( self.assertTrue(
settings["chainclients"]["namecoin"]["connection_type"] == "none" settings["chainclients"]["bitcoin"]["connection_type"] == "none"
) )
logger.info("Test addcoin existing") logger.info("Test addcoin existing")
testargs = [ testargs = [
"basicswap-prepare", "basicswap-prepare",
"-datadir=" + test_path_plain, "-datadir=" + test_path_plain,
"-addcoin=namecoin", "-addcoin=bitcoin",
] ]
with patch.object(sys, "argv", testargs): with patch.object(sys, "argv", testargs):
prepareSystem.main() prepareSystem.main()
with open(config_path) as fs: with open(config_path) as fs:
settings = json.load(fs) settings = json.load(fs)
self.assertTrue( self.assertTrue(
settings["chainclients"]["namecoin"]["connection_type"] == "rpc" settings["chainclients"]["bitcoin"]["connection_type"] == "rpc"
) )
logging.info("notorproxy") logging.info("notorproxy")