File: test_vtk_xml_reader.py

package info (click to toggle)
mayavi2 4.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,892 kB
  • sloc: python: 49,447; javascript: 32,885; makefile: 129; fortran: 60
file content (35 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Simple test to check the VTK XML reader -- this is basically a copy
of test_contour.py with just the reader changed.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005-2020,  Enthought, Inc.
# License: BSD Style.

# Standard library imports.
from os.path import abspath
import copy

# Local imports.
from common import TestCase, get_example_data
from test_vtk_data_source import TestVTKDataSource

class TestVTKXMLReader(TestVTKDataSource):
    def make_data(self):
        script = self.script
        from mayavi.sources.vtk_xml_file_reader import VTKXMLFileReader

        ############################################################
        # Create a new scene and set up the visualization.
        s = self.new_scene()

        # Read a VTK XML data file.
        r = VTKXMLFileReader()
        r.initialize(get_example_data('heart.vti'))
        script.add_source(r)

    def test(self):
        self.main()

if __name__ == "__main__":
    t = TestVTKXMLReader()
    t.test()