Exemplo n.º 1
0
 def test_group_create(self):
     postgres.group_create('testgroup',
                           user='******',
                           host='testhost',
                           port='testport',
                           maintenance_db='maint_db',
                           password='******',
                           createdb=False,
                           createuser=False,
                           encrypted=False,
                           superuser=False,
                           replication=False,
                           rolepassword='******',
                           groups='testgroup',
                           runas='foo')
     # postgres._run_psql.call_args[0][0] will contain the list of CLI args.
     # The first 13 elements of this list are initial args used in all (or
     # virtually all) commands run through _run_psql(), so the actual SQL
     # query will be in the 14th argument.
     self.assertTrue(
         postgres._run_psql.call_args[0][0][13].startswith('CREATE ROLE'))
Exemplo n.º 2
0
 def test_group_create(self):
     postgres.group_create('testgroup',
                           user='******',
                           host='testhost',
                           port='testport',
                           maintenance_db='maint_db',
                           password='******',
                           createdb=False,
                           createuser=False,
                           encrypted=False,
                           superuser=False,
                           replication=False,
                           rolepassword='******',
                           groups='testgroup',
                           runas='foo')
     self.assertTrue(
         re.match(
             '/usr/bin/pgsql --no-align --no-readline --no-password --username testuser '
             '--host testhost --port testport '
             '--dbname maint_db -c (\'|\")CREATE ROLE',
             postgres._run_psql.call_args[0][0]))
Exemplo n.º 3
0
 def test_group_create(self):
     postgres.group_create(
         'testgroup',
         user='******',
         host='testhost',
         port='testport',
         maintenance_db='maint_db',
         password='******',
         createdb=False,
         createuser=False,
         encrypted=False,
         superuser=False,
         replication=False,
         rolepassword='******',
         groups='testgroup',
         runas='foo'
     )
     self.assertTrue(re.match(
         '/usr/bin/pgsql --no-align --no-readline --no-password --username testuser '
         '--host testhost --port testport '
         '--dbname maint_db -c (\'|\")CREATE ROLE',
         postgres._run_psql.call_args[0][0]))
Exemplo n.º 4
0
 def test_group_create(self):
     postgres.group_create(
         'testgroup',
         user='******',
         host='testhost',
         port='testport',
         maintenance_db='maint_db',
         password='******',
         createdb=False,
         createuser=False,
         encrypted=False,
         superuser=False,
         replication=False,
         rolepassword='******',
         groups='testgroup',
         runas='foo'
     )
     # postgres._run_psql.call_args[0][0] will contain the list of CLI args.
     # The first 13 elements of this list are initial args used in all (or
     # virtually all) commands run through _run_psql(), so the actual SQL
     # query will be in the 14th argument.
     self.assertTrue(
         postgres._run_psql.call_args[0][0][13].startswith('CREATE ROLE')
     )