[test] add tests for eclair funding source (#2459)

* fix: test data

* test: add `status` tests

* refactor: try-catch

* test: create invoice tests

* test: add first `payinvoice` test

* test: add pay_invoice error test

* feat: allow more test options

* test: add pending tests

* fix: make check

* test: add, pending no fee

* fix: make consistent with other API calls

* test: more assertions

* test: add pending

* test: first payment status test

* test: pending status

* refactor: remove duplicate code

* refactor: rename field

* chore: code format

* chore: uniform
This commit is contained in:
Vlad Stan 2024-04-23 18:18:52 +03:00 committed by GitHub
parent 00f39a2007
commit 8d3b156738
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 740 additions and 86 deletions

View file

@ -23,7 +23,7 @@ class TestMock(BaseModel):
request_type: Optional[str]
request_body: Optional[dict]
response_type: str
response: Union[str, dict]
response: Union[str, dict, list]
class Mock(FunctionMock, TestMock):
@ -100,7 +100,11 @@ class WalletTest(BaseModel):
fs_mocks = fn["mocks"][fs_name]
test_mocks = test["mocks"][fs_name]
mocks = self._build_mock_objects(list(fs_mocks), fs_mocks, test_mocks)
all_test_mocks = [test_mocks] if isinstance(test_mocks, dict) else test_mocks
mocks = []
for tm in all_test_mocks:
mocks += self._build_mock_objects(list(fs_mocks), fs_mocks, tm)
return [self._tests_from_mock(m) for m in mocks]