InterSystems IRIS component of testcontainers-python.
Project description
Testcontainers-python for InterSystems IRIS
testcontainers-python facilitates the use of Docker containers for functional and integration testing.
Other implementations
Basic usage
>>> from testcontainers.iris import IRISContainer
>>> import sqlalchemy
>>> iris_container = IRISContainer("intersystemsdc/iris-community:latest")
>>> with iris_container as iris:
... engine = sqlalchemy.create_engine(iris.get_connection_url())
... with engine.begin() as connection:
... result = connection.execute(sqlalchemy.text("select $zversion"))
... version, = result.fetchone()
>>> version
'IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2023.2 (Build 227U) Mon Jul 31 2023 17:43:25 EDT'
The snippet above will spin up a InterSystems IRIS database in a container. The get_connection_url() convenience method returns a sqlalchemy compatible url we use to connect to the database and retrieve the database version.
It is possible to run Enterprise edition as well, with passing a valid iris.key.
iris_container = IRISContainer(
"containers.intersystems.com/intersystems/iris:2023.3",
license_key="/full/path/to/iris.key",
username="testuser",
password="testpass",
namespace="TEST",
)
username
, password
, namespace
will be created during start of the container with required values, user will get %All role
Demo with Jupiter Notebook
More extensive documentation can be found at Read The Docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for testcontainers_iris-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 239955133fd75a34a1c8ee85bb3d6e863267046056df5a12ee873b91be299e59 |
|
MD5 | 133889c2dd6402151045c584a7ded45b |
|
BLAKE2b-256 | 863d4ba3d1f256ec2232cb65f6e0f7dfceb31c98ebb4b39842123c755b9f6a60 |
Hashes for testcontainers_iris-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb26ccb1786c21d40ede7d880d2fc83d3b2e8f7fbae82d0942a7377ccf7ce3c1 |
|
MD5 | c43432ca28fce465d1ebc519b6dd6c1a |
|
BLAKE2b-256 | afaed6cdcce41b81f19d37ed8dc8dfd0ac4dee61808ed0d5ccfc7c6a6771a5be |