File: application.py

package info (click to toggle)
camitk 6.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 389,508 kB
  • sloc: cpp: 103,476; sh: 2,448; python: 1,618; xml: 984; makefile: 128; perl: 84; sed: 20
file content (17 lines) | stat: -rw-r--r-- 875 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#
# Script designed to be tested from inside the CamiTK Python interpreter using PythonManager::runScript
# See TestPythonScript.cpp
# 
# The requirements (if any) must defined in the the QRC file
#
import camitk

count = len(camitk.Application.getTopLevelComponents())
assert count == 0, 'There should be not component opened yet'

camitk.Application.open(camitk.Core.getTestDataDir() + "/amos_0336.camitk")

assert len(camitk.Application.getTopLevelComponents()) == 16, f"There should 16 top level components in amos_0336 not {camitk.Application.getTopLevelComponents()}"
assert camitk.Application.getTopLevelComponents()[0].getName() == "amos_0336", f"The first top level component should be amos_0336 not {camitk.Application.getTopLevelComponents()[0].getName()}"

assert camitk.Application.closeAll(), f"Close all should return true as no components have been modified"