From be140a72f793a06aa1efcd7d350a76b4c4b60d9a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 5 Jan 2021 22:04:22 +0100 Subject: [PATCH] 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. --- backup/test_backup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backup/test_backup.py b/backup/test_backup.py index 39be691..ccce5e8 100644 --- a/backup/test_backup.py +++ b/backup/test_backup.py @@ -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)