Example #1
0
 def test_db_create(self):
     postgres.db_create(
         'dbname',
         user='******',
         host='testhost',
         port='testport',
         maintenance_db='maint_db',
         password='******',
         tablespace='testspace',
         owner='otheruser',
         runas='foo'
     )
     postgres._run_psql.assert_called_once_with(
         '/usr/bin/pgsql --no-align --no-readline --no-password --username testuser '
         '--host testhost --port testport --dbname maint_db -c '
         '\'CREATE DATABASE "dbname" '
         'WITH TABLESPACE = testspace OWNER = "otheruser"\'',
         host='testhost', user='******',
         password='******', runas='foo', port='testport')
Example #2
0
 def test_db_create(self):
     postgres.db_create(
         'dbname',
         user='******',
         host='testhost',
         port='testport',
         maintenance_db='maint_db',
         password='******',
         tablespace='testspace',
         owner='otheruser',
         runas='foo'
     )
     postgres._run_psql.assert_called_once_with(
         '/usr/bin/pgsql --no-align --no-readline --username testuser '
         '--host testhost --port testport --dbname maint_db -c '
         '\'CREATE DATABASE "dbname" '
         'WITH TABLESPACE = testspace OWNER = "otheruser"\'',
         host='testhost', user='******',
         password='******', runas='foo', port='testport')
Example #3
0
    def test_db_create(self):
        postgres.db_create(
            'dbname',
            user='******',
            host='testhost',
            port='testport',
            maintenance_db='maint_db',
            password='******',
            tablespace='testspace',
            owner='otheruser',
            runas='foo'
        )

        postgres._run_psql.assert_called_once_with(
            ['/usr/bin/pgsql', '--no-align', '--no-readline',
             '--no-password', '--username', 'testuser', '--host',
             'testhost', '--port', 'testport', '--dbname', 'maint_db',
             '-c', 'CREATE DATABASE "dbname" WITH TABLESPACE = testspace '
                   'OWNER = "otheruser"'],
            host='testhost', user='******',
            password='******', runas='foo', port='testport')
Example #4
0
    def test_db_create(self):
        postgres.db_create('dbname',
                           user='******',
                           host='testhost',
                           port='testport',
                           maintenance_db='maint_db',
                           password='******',
                           tablespace='testspace',
                           owner='otheruser',
                           runas='foo')

        postgres._run_psql.assert_called_once_with([
            '/usr/bin/pgsql', '--no-align', '--no-readline', '--no-password',
            '--username', 'testuser', '--host', 'testhost', '--port',
            'testport', '--dbname', 'maint_db', '-c',
            'CREATE DATABASE "dbname" WITH TABLESPACE = testspace '
            'OWNER = "otheruser"'
        ],
                                                   host='testhost',
                                                   user='******',
                                                   password='******',
                                                   runas='foo',
                                                   port='testport')