Skip to content

Commit

Permalink
Added test of Python binding to Spatial Pooler writeToString
Browse files Browse the repository at this point in the history
  • Loading branch information
fcr committed Jul 7, 2019
1 parent b59f646 commit 3c4d421
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bindings/py/tests/algorithms/spatial_pooler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ def testNupicSpatialPoolerPickling(self):
self.assertEqual(sp.getNumColumns(), sp2.getNumColumns(),
"Simple NuPIC SpatialPooler pickle/unpickle failed.")

def testNupicSpatialPoolerSavingToString(self):
"""Test writing to and reading from NuPIC SpatialPooler."""

# Simple test: make sure that writing/reading works...
sp = SP()
s = sp.writeToString()

sp2 = sp.readFromString(s)

self.assertEqual(sp.getNumColumns(), sp2.getNumColumns(),
"NuPIC SpatialPooler write to/read from string failed.")



if __name__ == "__main__":
unittest.main()

0 comments on commit 3c4d421

Please sign in to comment.