mirror of
https://github.com/aljazceru/plugins.git
synced 2026-01-07 15:24:21 +01:00
backup: Use dummy backend in test_rewrite
Additional checking was added that a file exists when `create=False`, this runs into an error with the `test_rewrite()` test. Update the test to use dummy backend for the test, as it tests a method on the base class, not any specific backend.
This commit is contained in:
committed by
Christian Decker
parent
7819fef71e
commit
be140a72f7
@@ -1,3 +1,4 @@
|
||||
from backend import Backend
|
||||
from filebackend import FileBackend
|
||||
from flaky import flaky
|
||||
from pyln.testing.fixtures import * # noqa: F401,F403
|
||||
@@ -230,6 +231,9 @@ def test_warning(directory, node_factory):
|
||||
r'The `--backup-destination` option is deprecated and will be removed in future versions of the backup plugin.'
|
||||
))
|
||||
|
||||
class DummyBackend(Backend):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def test_rewrite():
|
||||
tests = [
|
||||
@@ -239,7 +243,7 @@ def test_rewrite():
|
||||
),
|
||||
]
|
||||
|
||||
b = FileBackend('destination', create=False)
|
||||
b = DummyBackend()
|
||||
|
||||
for i, o in tests:
|
||||
assert(b._rewrite_stmt(i) == o)
|
||||
|
||||
Reference in New Issue
Block a user