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')
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')
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)
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')
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')
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)