backup: cleanup flake8 nits

This commit is contained in:
Michael Schmoock
2020-11-30 15:49:30 +01:00
committed by Christian Decker
parent be523aa54f
commit 1f05674b5b
2 changed files with 9 additions and 13 deletions

View File

@@ -1,8 +1,6 @@
from backup import FileBackend
from flaky import flaky
from pyln.client import RpcError
from pyln.testing.fixtures import *
from pyln.client import RpcError
from pyln.testing.fixtures import * # noqa: F401,F403
import os
import pytest
import subprocess
@@ -15,6 +13,7 @@ cli_path = os.path.join(os.path.dirname(__file__), "backup-cli")
# For the transition period we require deprecated_apis to be true
deprecated_apis = True
def test_start(node_factory, directory):
bpath = os.path.join(directory, 'lightning-1', 'regtest')
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
@@ -23,7 +22,7 @@ def test_start(node_factory, directory):
opts = {
'plugin': plugin_path,
'allow-deprecated-apis': deprecated_apis,
}
}
l1 = node_factory.get_node(options=opts, cleandir=False)
plugins = [os.path.basename(p['name']) for p in l1.rpc.plugin("list")['plugins']]
assert("backup.py" in plugins)
@@ -39,7 +38,6 @@ def test_start_no_init(node_factory, directory):
"""The plugin should refuse to start if we haven't initialized the backup
"""
bpath = os.path.join(directory, 'lightning-1', 'regtest')
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
os.makedirs(bpath)
opts = {
'plugin': plugin_path,
@@ -95,7 +93,7 @@ def test_tx_abort(node_factory, directory):
opts = {
'plugin': plugin_path,
'allow-deprecated-apis': deprecated_apis,
}
}
l1 = node_factory.get_node(options=opts, cleandir=False)
l1.stop()
@@ -125,10 +123,10 @@ def test_failing_restore(node_factory, directory):
opts = {
'plugin': plugin_path,
'allow-deprecated-apis': deprecated_apis,
}
}
def section(comment):
print("="*25, comment, "="*25)
print("=" * 25, comment, "=" * 25)
section("Starting node for the first time")
l1 = node_factory.get_node(options=opts, cleandir=False, may_fail=True)
@@ -158,7 +156,7 @@ def test_intermittent_backup(node_factory, directory):
opts = {
'plugin': plugin_path,
'allow-deprecated-apis': deprecated_apis,
}
}
l1 = node_factory.get_node(options=opts, cleandir=False, may_fail=True)
# Now start without the plugin. This should work fine.
@@ -184,7 +182,7 @@ def test_restore(node_factory, directory):
opts = {
'plugin': plugin_path,
'allow-deprecated-apis': deprecated_apis,
}
}
l1 = node_factory.get_node(options=opts, cleandir=False)
l1.stop()
@@ -200,7 +198,7 @@ def test_restore_dir(node_factory, directory):
opts = {
'plugin': plugin_path,
'allow-deprecated-apis': deprecated_apis,
}
}
l1 = node_factory.get_node(options=opts, cleandir=False)
l1.stop()