skipcheck

TM1 Testcontainers · Docs · Where TM1 comes from

Tm1Seed

from skipcheck_tm1_testcontainers import Tm1Seed

Used in the walkthrough Test your code against a real TM1.

Objects the image puts into an empty database on first start (its TM1_SEED setting). The samples come from the TM1 install itself, so they're only available where the install includes them.

A server seeded with IBM's SData sample:

source = Tm1Source.discover()
if source is None:
    raise RuntimeError("Set TM1_HOME_DIR or TM1_BUNDLE_DIR")
# SData's login is admin / apple, and the server must be this version
container = Tm1ServerContainer(source).with_seed(Tm1Seed.SDATA).with_expected_version(Tm1Version.parse("11.8.03500.6"))
# Entering the block starts the container, and leaving it stops it
with container as server:
    # The client's block is the inner one, so its session closes before the container stops
    with Tm1Client.builder().base_url(server.rest_url).basic_auth(server.username, server.password).build() as tm1:
        # SData's cubes, such as SalesCube
        return [cube.name for cube in tm1.cubes.model_cubes(ODataQuery.none().select(Cube.NAME))]

Members

EMPTY staticNo objects.
SDATA staticIBM's SData sample, with the login admin / apple.
username propertyThe user the seed's database logs in as.
password propertyThat user's password, empty for none.

EMPTY

static
EMPTY

No objects: an empty database with the login admin and no password.

SDATA

static
SDATA

IBM's SData sample, with the login admin / apple.

username

property
username: str

The user the seed's database logs in as.

password

property
password: str

That user's password, empty for none.