Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
Update py_region_test for new behavior and make sure the test is run …
Browse files Browse the repository at this point in the history
…in CI.
  • Loading branch information
scottpurdy committed Sep 28, 2016
1 parent b889e19 commit d9c896c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ script:
# legacy binary tests
- "${TRAVIS_BUILD_DIR}/build/release/bin/connections_performance_test"
- "${TRAVIS_BUILD_DIR}/build/release/bin/cpp_region_test"
- "${TRAVIS_BUILD_DIR}/build/release/bin/py_region_test"
- "${TRAVIS_BUILD_DIR}/build/release/bin/helloregion"
- "${TRAVIS_BUILD_DIR}/build/release/bin/hello_sp_tp"
- "${TRAVIS_BUILD_DIR}/build/release/bin/prototest"
Expand Down
1 change: 1 addition & 0 deletions ci/bamboo/build-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mkdir -p build/scripts
cmake -DCMAKE_INSTALL_PREFIX=`pwd`/build/release -DPY_EXTENSIONS_DIR=`pwd`/bindings/py/nupic/bindings .
make install
./build/release/bin/cpp_region_test
./build/release/bin/py_region_test
./build/release/bin/unit_tests

# Build wheel
Expand Down
15 changes: 4 additions & 11 deletions src/test/integration/PyRegionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,26 +286,19 @@ void testSecondTimeLeak()
n.addRegion("r2", "py.TestNode", "");
}

void testFailOnRegisterDuplicateRegion()
void testRegionDuplicateRegister()
{
bool caughtException = false;
Network::registerPyRegion("nupic.regions.TestDuplicateNodes",
"TestDuplicateNodes");
try
{
Network::registerPyRegion("nupic.regions.TestDuplicateNodes",
"TestDuplicateNodes");
} catch (std::exception& e) {
NTA_DEBUG << "Caught exception as expected: '" << e.what() << "'";
caughtException = true;
}
if (caughtException)
{
NTA_DEBUG << "testFailOnRegisterDuplicateRegion passed";
} else {
NTA_THROW << "testFailOnRegisterDuplicateRegion did not "
<< "throw an exception as expected";
NTA_THROW << "testRegionDuplicateRegister failed with exception: '"
<< e.what() << "'";
}
NTA_DEBUG << "testRegionDuplicateRegister passed";
}

void testCreationParamTypes()
Expand Down

0 comments on commit d9c896c

Please sign in to comment.