-def test_create_db_already_exists(temp_db):
- with pytest.raises(UsageError):
- database_import.create_db('dbname=' + temp_db)
-
-
-def test_create_db_unsupported_version(nonexistant_db, monkeypatch):
- monkeypatch.setattr(database_import, 'POSTGRESQL_REQUIRED_VERSION', (100, 4))
-
- with pytest.raises(UsageError, match='PostgreSQL server is too old.'):
- database_import.create_db('dbname=' + nonexistant_db)
-
-
-def test_create_db_missing_ro_user(nonexistant_db):
- with pytest.raises(UsageError, match='Missing read-only user.'):
- database_import.create_db('dbname=' + nonexistant_db, rouser='sdfwkjkjgdugu2;jgsafkljas;')