예제 #1
0
 def test_schema_create(self):
     postgres.schema_create(
         'test_db',
         'test_schema',
         user='******',
         db_host='test_host',
         db_port='test_port',
         db_user='******',
         db_password='******'
     )
     postgres._run_psql.assert_called_once_with(
         "/usr/bin/pgsql --no-align --no-readline --no-password "
         "--username test_user "
         "--host test_host --port test_port "
         "--dbname test_db -c 'CREATE SCHEMA test_schema'",
         host='test_host', port='test_port',
         password='******', user='******', runas='user')
예제 #2
0
파일: postgres_test.py 프로젝트: mahak/salt
 def test_schema_create(self):
     postgres.schema_create(
         'maint_db',
         'testschema',
         user='******',
         db_host='testhost',
         db_port='testport',
         db_user='******',
         db_password='******'
     )
     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 SCHEMA "testschema"'],
         host='testhost', port='testport',
         password='******', user='******', runas='user')
예제 #3
0
 def test_schema_create2(self):
     ret = postgres.schema_create('test_db',
                                  'test_schema',
                                  user='******',
                                  db_host='test_host',
                                  db_port='test_port',
                                  db_user='******',
                                  db_password='******')
     self.assertFalse(ret)
예제 #4
0
 def test_schema_create(self):
     postgres.schema_create('test_db',
                            'test_schema',
                            user='******',
                            db_host='test_host',
                            db_port='test_port',
                            db_user='******',
                            db_password='******')
     postgres._run_psql.assert_called_once_with(
         "/usr/bin/pgsql --no-align --no-readline --no-password "
         "--username test_user "
         "--host test_host --port test_port "
         "--dbname test_db -c 'CREATE SCHEMA test_schema'",
         host='test_host',
         port='test_port',
         password='******',
         user='******',
         runas='user')
예제 #5
0
 def test_schema_create(self):
     postgres.schema_create('maint_db',
                            'testschema',
                            user='******',
                            db_host='testhost',
                            db_port='testport',
                            db_user='******',
                            db_password='******')
     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 SCHEMA "testschema"'
     ],
                                                host='testhost',
                                                port='testport',
                                                password='******',
                                                user='******',
                                                runas='user')
예제 #6
0
 def test_schema_create2(self):
     ret = postgres.schema_create('test_db',
                                  'test_schema',
                                  user='******',
                                  db_host='test_host',
                                  db_port='test_port',
                                  db_user='******',
                                  db_password='******'
                                  )
     self.assertFalse(ret)