diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/hier_block_test.py (renamed from tests/import_test.py) | 9 | ||||
-rw-r--r-- | tests/thread_pool_test.py | 22 |
3 files changed, 26 insertions, 8 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index be70903..6315014 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,4 +11,5 @@ list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_SOURCE_DIR}/python) list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_BINARY_DIR}/python) list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras) list(APPEND GR_TEST_PYTHON_DIRS ${GRAS_BINARY_DIR}/python/gras/${CMAKE_BUILD_TYPE}) -GR_ADD_TEST(import_test ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/import_test.py) +GR_ADD_TEST(hier_block ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/hier_block_test.py) +GR_ADD_TEST(thread_pool ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/thread_pool_test.py) diff --git a/tests/import_test.py b/tests/hier_block_test.py index 4ccd00e..78bb1a0 100644 --- a/tests/import_test.py +++ b/tests/hier_block_test.py @@ -1,23 +1,18 @@ import unittest +import gras -class ImportTest(unittest.TestCase): - - def test_import(self): - import gras +class HierBlockTest(unittest.TestCase): def test_expected_attrs(self): - import gras self.assertTrue(hasattr(gras, 'HierBlock')) self.assertTrue(hasattr(gras, 'TopBlock')) def test_make_hier(self): - import gras h = gras.HierBlock('my_hb') print h def test_make_top(self): - import gras t = gras.TopBlock('my_tb') print t diff --git a/tests/thread_pool_test.py b/tests/thread_pool_test.py new file mode 100644 index 0000000..4ddc60d --- /dev/null +++ b/tests/thread_pool_test.py @@ -0,0 +1,22 @@ + +import unittest +import gras + +class ThreadPoolTest(unittest.TestCase): + + def test_make_config(self): + c = gras.ThreadPoolConfig() + print c.thread_count + print c.yield_strategy + + def test_make_tp(self): + c = gras.ThreadPoolConfig() + tp = gras.ThreadPool(c) + + def test_make_tp_set_active(self): + c = gras.ThreadPoolConfig() + tp = gras.ThreadPool(c) + tp.set_active() + +if __name__ == '__main__': + unittest.main() |