def test_version(self): postgres.version(user='******', host='test_host', port='test_port', maintenance_db='test_maint', password='******', 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( re.match('SELECT setting FROM pg_catalog.pg_settings', postgres._run_psql.call_args[0][0][13]))
def test_version(self): postgres.version(user='******', host='test_host', port='test_port', maintenance_db='test_maint', password='******', runas='foo') self.assertTrue( re.match( '/usr/bin/pgsql --no-align --no-readline --username test_user ' '--host test_host --port test_port ' '--dbname test_maint ' '-c (\'|\")SELECT setting FROM pg_catalog.pg_settings', postgres._run_psql.call_args[0][0]))
def test_version(self): postgres.version( user='******', host='test_host', port='test_port', maintenance_db='test_maint', password='******', runas='foo' ) self.assertTrue(re.match( '/usr/bin/pgsql --no-align --no-readline --no-password --username test_user ' '--host test_host --port test_port ' '--dbname test_maint ' '-c (\'|\")SELECT setting FROM pg_catalog.pg_settings', postgres._run_psql.call_args[0][0]))
def test_version(self): postgres.version( user='******', host='test_host', port='test_port', maintenance_db='test_maint', password='******', 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( re.match( 'SELECT setting FROM pg_catalog.pg_settings', postgres._run_psql.call_args[0][0][13] ) )