electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 73e656522e06be1989b95855f79aefec1cb0e006
parent 149cd9598a0f9d0e4481e41cecbab23a28fe62c7
Author: ThomasV <thomasv@electrum.org>
Date:   Mon,  3 Feb 2020 15:15:29 +0100

regests: organize tests in two classes

Diffstat:
Melectrum/tests/regtest.py | 21+++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/electrum/tests/regtest.py b/electrum/tests/regtest.py @@ -17,9 +17,6 @@ class TestLightning(unittest.TestCase): def setUp(self): test_name = self.id().split('.')[-1] sys.stdout.write("***** %s ******\n" % test_name) - self.agents = ['alice', 'bob'] - if test_name in ['test_forwarding', 'test_watchtower']: - self.agents.append('carol') # initialize and get funds for agent in self.agents: self.run_shell(['init', agent]) @@ -35,14 +32,13 @@ class TestLightning(unittest.TestCase): for agent in self.agents: self.run_shell(['stop', agent]) + +class TestLightningAB(TestLightning): + agents = ['alice', 'bob'] + def test_breach(self): self.run_shell(['breach']) - def test_forwarding(self): - self.run_shell(['open']) - self.run_shell(['alice_pays_carol']) - self.run_shell(['close']) - def test_redeem_htlcs(self): self.run_shell(['redeem_htlcs']) @@ -52,5 +48,14 @@ class TestLightning(unittest.TestCase): def test_breach_with_spent_htlc(self): self.run_shell(['breach_with_spent_htlc']) + +class TestLightningABC(TestLightning): + agents = ['alice', 'bob', 'carol'] + + def test_forwarding(self): + self.run_shell(['open']) + self.run_shell(['alice_pays_carol']) + self.run_shell(['close']) + def test_watchtower(self): self.run_shell(['watchtower'])