Tm1Seed
from skipcheck_tm1_testcontainers import Tm1SeedUsed 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 static | No objects. |
SDATA static | IBM's SData sample, with the login admin / apple. |
username property | The user the seed's database logs in as. |
password property | That user's password, empty for none. |
EMPTY
staticEMPTYNo objects: an empty database with the login admin and no password.
SDATA
staticSDATAIBM's SData sample, with the login admin / apple.
username
propertyusername: strThe user the seed's database logs in as.
password
propertypassword: strThat user's password, empty for none.