testConstructedAPI.py 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#=============================================================================
#
#  Copyright (c) Kitware, Inc.
#  All rights reserved.
#  See LICENSE.txt for details.
#
#  This software is distributed WITHOUT ANY WARRANTY; without even
#  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#  PURPOSE.  See the above copyright notice for more information.
#
#=============================================================================
import unittest
import smtk
import smtk.attribute
import smtk.operation
import smtk.testing
import re


class TestConstructedAPI(smtk.testing.TestCase):

    def testConstructedAPI(self):
23
        op = smtk.operation.WriteResource.create()
24 25 26
        parameters = op.parameters()
        assert(hasattr(parameters, 'setFilename'))
        assert(hasattr(parameters, 'filename'))
27 28 29
        filename = 'foo.smtk'
        parameters.setFilename(filename)
        assert(parameters.filename() == filename)
30 31 32 33
        assert(hasattr(parameters, 'setDebugLevel'))
        assert(hasattr(parameters, 'debugLevel'))
        assert(hasattr(parameters, 'enableDebugLevel'))
        assert(hasattr(parameters, 'debugLevelEnabled'))
34 35 36 37
        parameters.enableDebugLevel(True)
        assert(parameters.debugLevelEnabled() == True)
        parameters.setDebugLevel(3)
        assert(parameters.debugLevel() == 3)
38 39 40 41 42


if __name__ == '__main__':
    smtk.testing.process_arguments()
    unittest.main()