(node_factory)
| 722 | |
| 723 | |
| 724 | def test_dynamic_path_conflicts(node_factory): |
| 725 | l1, base_url, ca_cert = start_node_with_clnrest( |
| 726 | node_factory, os.path.join(os.getcwd(), "tests/plugins/dynamic_clnrest_path.py") |
| 727 | ) |
| 728 | |
| 729 | with pytest.raises( |
| 730 | RpcError, match="already exists with http_method: GET" |
| 731 | ): |
| 732 | l1.rpc.call( |
| 733 | "clnrest-register-path", |
| 734 | { |
| 735 | "path": r"v{version}/{capture}/go", |
| 736 | "rpc_method": "capture-route", |
| 737 | "rune_restrictions": {"params": {"amount_msat": 9999}}, |
| 738 | "http_method": "GET", |
| 739 | }, |
| 740 | ) |
| 741 | |
| 742 | with pytest.raises( |
| 743 | RpcError, match="already exists with http_method: GET" |
| 744 | ): |
| 745 | l1.rpc.call( |
| 746 | "clnrest-register-path", |
| 747 | { |
| 748 | "path": r"v1/{capture}/go", |
| 749 | "rpc_method": "capture-route", |
| 750 | "rune_restrictions": {"params": {"amount_msat": 9999}}, |
| 751 | "http_method": "GET", |
| 752 | }, |
| 753 | ) |
| 754 | |
| 755 | l1.rpc.call( |
| 756 | "clnrest-register-path", |
| 757 | { |
| 758 | "path": r"v1/{capture}/go", |
| 759 | "rpc_method": "capture-route", |
| 760 | "rune_restrictions": {"params": {"amount_msat": 9999}}, |
| 761 | }, |
| 762 | ) |
| 763 | |
| 764 | l1.rpc.call( |
| 765 | "clnrest-register-path", |
| 766 | { |
| 767 | "path": r"v1/keys/{keyset_id}", |
| 768 | "rpc_method": "normal-route", |
| 769 | }, |
| 770 | ) |
| 771 | |
| 772 | l1.rpc.call( |
| 773 | "clnrest-register-path", |
| 774 | { |
| 775 | "path": r"v1/keys", |
| 776 | "rpc_method": "normal-route", |
| 777 | }, |
| 778 | ) |
| 779 | |
| 780 | with pytest.raises(RpcError, match="Path must not be root"): |
| 781 | l1.rpc.call( |
nothing calls this directly
no test coverage detected