コード例 #1
0
ファイル: postgres.py プロジェクト: Tibodef/PythonBlog
 def setUp(self):
     super(PostgresDisconnectionTestWithPGBouncerBase, self).setUp()
     database_uri = URI(os.environ["STORM_POSTGRES_HOST_URI"])
     database_user = database_uri.username or os.environ['USER']
     database_dsn = make_dsn(database_uri)
     # Create a pgbouncer fixture.
     self.pgbouncer = pgbouncer.fixture.PGBouncerFixture()
     self.pgbouncer.databases[database_uri.database] = database_dsn
     self.pgbouncer.users[database_user] = "trusted"
     self.pgbouncer.admin_users = [database_user]
     self.useFixture(self.pgbouncer)
     # Create a Database that uses pgbouncer.
     pgbouncer_uri = database_uri.copy()
     pgbouncer_uri.host = self.pgbouncer.host
     pgbouncer_uri.port = self.pgbouncer.port
     self.database = create_database(pgbouncer_uri)
コード例 #2
0
ファイル: postgres.py プロジェクト: welitonfreitas/storm-py3
 def setUp(self):
     super(PostgresDisconnectionTestWithPGBouncerBase, self).setUp()
     database_uri = URI(os.environ["STORM_POSTGRES_HOST_URI"])
     database_user = database_uri.username or os.environ['USER']
     database_dsn = make_dsn(database_uri)
     # Create a pgbouncer fixture.
     self.pgbouncer = pgbouncer.fixture.PGBouncerFixture()
     self.pgbouncer.databases[database_uri.database] = database_dsn
     self.pgbouncer.users[database_user] = "trusted"
     self.pgbouncer.admin_users = [database_user]
     self.useFixture(self.pgbouncer)
     # Create a Database that uses pgbouncer.
     pgbouncer_uri = database_uri.copy()
     pgbouncer_uri.host = self.pgbouncer.host
     pgbouncer_uri.port = self.pgbouncer.port
     self.database = create_database(pgbouncer_uri)
コード例 #3
0
ファイル: test_uri.py プロジェクト: runfalk/storm-legacy
def test_copy():
    uri = URI("scheme:///db?opt=value")
    uri_copy = uri.copy()
    assert uri_copy is not uri
    assert uri_copy.__dict__ == uri.__dict__
    assert uri_copy.options is not uri.options
コード例 #4
0
ファイル: uri.py プロジェクト: olivecoder/mamba-storm
 def test_copy(self):
     uri = URI("scheme:///db?opt=value")
     uri_copy = uri.copy()
     self.assertTrue(uri_copy is not uri)
     self.assertTrue(uri_copy.__dict__ == uri.__dict__)
     self.assertTrue(uri_copy.options is not uri.options)
コード例 #5
0
ファイル: uri.py プロジェクト: DamnWidget/mamba-storm
 def test_copy(self):
     uri = URI("scheme:///db?opt=value")
     uri_copy = uri.copy()
     self.assertTrue(uri_copy is not uri)
     self.assertTrue(uri_copy.__dict__ == uri.__dict__)
     self.assertTrue(uri_copy.options is not uri.options)