MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_psql_key_value_dsn

Function test_psql_key_value_dsn

tests/test_db.py:350–363  ·  view source on GitHub ↗
(node_factory, db_provider, monkeypatch)

Source from the content-addressed store, hash-verified

348
349@unittest.skipIf(os.environ.get('TEST_DB_PROVIDER', None) != 'postgres', "Only applicable to postgres")
350def 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(

Callers

nothing calls this directly

Calls 1

get_nodeMethod · 0.45

Tested by

no test coverage detected