def test_cluster_create(self): deb_postgres.cluster_create('9.3', 'main', port='5432', locale='fr_FR', encoding='UTF-8', datadir='/opt/postgresql') cmdstr = '/usr/bin/pg_createcluster ' \ '--port 5432 --locale fr_FR --encoding UTF-8 ' \ '--datadir /opt/postgresql ' \ '9.3 main' self.assertEqual(cmdstr, self.cmd_run_all_mock.call_args[0][0])
def test_cluster_create(self): deb_postgres.cluster_create( "9.3", "main", port="5432", locale="fr_FR", encoding="UTF-8", datadir="/opt/postgresql" ) cmd = SALT_STUB["cmd.run_all"] cmdstr = ( "/usr/bin/pg_createcluster " "--port 5432 --locale fr_FR --encoding UTF-8 " "--datadir /opt/postgresql " "9.3 main" ) self.assertEqual(cmdstr, cmd.call_args[0][0])
def test_cluster_create_with_float(self): deb_postgres.cluster_create( 9.3, "main", port="5432", locale="fr_FR", encoding="UTF-8", datadir="/opt/postgresql", ) cmdstr = ("/usr/bin/pg_createcluster " "--port 5432 --locale fr_FR --encoding UTF-8 " "--datadir /opt/postgresql " "9.3 main") self.assertEqual(cmdstr, self.cmd_run_all_mock.call_args[0][0])
def test_cluster_create(self): deb_postgres.cluster_create( '9.3', 'main', port='5432', locale='fr_FR', encoding='UTF-8', datadir='/opt/postgresql' ) cmd = SALT_STUB['cmd.run_all'] cmdstr = '/usr/bin/pg_createcluster ' \ '--port 5432 --locale fr_FR --encoding UTF-8 ' \ '--datadir /opt/postgresql ' \ '9.3 main' self.assertEqual(cmdstr, cmd.call_args[0][0])
def test_cluster_create_with_initdb_options(self): deb_postgres.cluster_create('11', 'main', port='5432', locale='fr_FR', encoding='UTF-8', datadir='/opt/postgresql', allow_group_access=True, data_checksums=True, wal_segsize='32') cmdstr = '/usr/bin/pg_createcluster ' \ '--port 5432 --locale fr_FR --encoding UTF-8 ' \ '--datadir /opt/postgresql ' \ '11 main ' \ '-- ' \ '--allow-group-access ' \ '--data-checksums ' \ '--wal-segsize 32' self.assertEqual(cmdstr, self.cmd_run_all_mock.call_args[0][0])
def test_cluster_create_with_initdb_options(self): deb_postgres.cluster_create( "11", "main", port="5432", locale="fr_FR", encoding="UTF-8", datadir="/opt/postgresql", allow_group_access=True, data_checksums=True, wal_segsize="32", ) cmdstr = ("/usr/bin/pg_createcluster " "--port 5432 --locale fr_FR --encoding UTF-8 " "--datadir /opt/postgresql " "11 main " "-- " "--allow-group-access " "--data-checksums " "--wal-segsize 32") self.assertEqual(cmdstr, self.cmd_run_all_mock.call_args[0][0])