mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-19 14:14:20 +01:00
backup: restore default filename lightningd.sqlite3
This commit is contained in:
committed by
Christian Decker
parent
9591c1b31e
commit
be523aa54f
@@ -192,6 +192,27 @@ def test_restore(node_factory, directory):
|
||||
subprocess.check_call([cli_path, "restore", bdest, rdest])
|
||||
|
||||
|
||||
def test_restore_dir(node_factory, directory):
|
||||
bpath = os.path.join(directory, 'lightning-1', 'regtest')
|
||||
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
|
||||
os.makedirs(bpath)
|
||||
subprocess.check_call([cli_path, "init", bpath, bdest])
|
||||
opts = {
|
||||
'plugin': plugin_path,
|
||||
'allow-deprecated-apis': deprecated_apis,
|
||||
}
|
||||
l1 = node_factory.get_node(options=opts, cleandir=False)
|
||||
l1.stop()
|
||||
|
||||
# should raise error without remove_existing
|
||||
with pytest.raises(Exception):
|
||||
subprocess.check_call([cli_path, "restore", bdest, bpath])
|
||||
|
||||
# but succeed when we remove the sqlite3 dbfile before
|
||||
os.remove(os.path.join(bpath, "lightningd.sqlite3"))
|
||||
subprocess.check_call([cli_path, "restore", bdest, bpath])
|
||||
|
||||
|
||||
def test_warning(directory, node_factory):
|
||||
bpath = os.path.join(directory, 'lightning-1', 'regtest')
|
||||
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
|
||||
|
||||
Reference in New Issue
Block a user