| 348 | |
| 349 | @unittest.skipIf(os.environ.get('TEST_DB_PROVIDER', None) != 'postgres', "Only applicable to postgres") |
| 350 | def test_psql_key_value_dsn(node_factory, db_provider, monkeypatch): |
| 351 | from pyln.testing.db import PostgresDb |
| 352 | |
| 353 | # Override get_dsn method to use the key-value style DSN |
| 354 | def get_dsn(self): |
| 355 | print("hello") |
| 356 | return "postgres://host=127.0.0.1 port={port} user=postgres password=password dbname={dbname}".format( |
| 357 | port=self.port, dbname=self.dbname |
| 358 | ) |
| 359 | |
| 360 | monkeypatch.setattr(PostgresDb, "get_dsn", get_dsn) |
| 361 | l1 = node_factory.get_node() |
| 362 | opt = [o for o in l1.daemon.cmd_line if '--wallet' in o][0] |
| 363 | assert('host=127.0.0.1' in opt) |
| 364 | |
| 365 | |
| 366 | @unittest.skipIf( |