1
0

tests: rework testnet

Inheritance was overkill here, and now we can use inheritance for new functionality X
without having to create classes for all combinations of {X, is_testnet}.
This commit is contained in:
SomberNight
2023-02-18 06:44:30 +00:00
parent 72e1be6f5e
commit c5bdd5007c
12 changed files with 66 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
import os
import time
from . import TestCaseForTestnet
from . import ElectrumTestCase
from electrum.simple_config import SimpleConfig
from electrum.wallet import restore_wallet_from_text, Standard_Wallet, Abstract_Wallet
@@ -11,18 +11,19 @@ from electrum.transaction import Transaction, PartialTxOutput
from electrum.util import TxMinedInfo
class TestWalletPaymentRequests(TestCaseForTestnet):
class TestWalletPaymentRequests(ElectrumTestCase):
"""test 'incoming' invoices"""
TESTNET = True
def setUp(self):
TestCaseForTestnet.setUp(self)
super().setUp()
self.config = SimpleConfig({'electrum_path': self.electrum_path})
self.wallet1_path = os.path.join(self.electrum_path, "somewallet1")
self.wallet2_path = os.path.join(self.electrum_path, "somewallet2")
self._orig_get_cur_time = Invoice._get_cur_time
def tearDown(self):
TestCaseForTestnet.tearDown(self)
super().tearDown()
Invoice._get_cur_time = staticmethod(self._orig_get_cur_time)
def create_wallet2(self) -> Standard_Wallet: