code: def testInvalidParameterSpec(self):
      with self.assertRaises(Exception):
          _x = ParameterSpec()
  
      with self.assertRaises(Exception):
          _x = ParameterSpec(
              dataType="int", count=4, defaultValue="not an int"
          )
  
      with self.assertRaises(Exception):
          _x = ParameterSpec(description=555, dataType="int")
  
      with self.assertRaises(Exception):
          _x = ParameterSpec(dataType="int", accessMode="no such mode")
  
      with self.assertRaises(Exception):
          _x = ParameterSpec(
              dataType="int", defaultValue=5, accessMode="Read"
          )
  
file_path: nupic-legacy/tests/unit/nupic/regions/regions_spec_test.py
imports: import unittest2
  from nupic.regions.spec import Spec, InputSpec, OutputSpec, ParameterSpec, CommandSpec
label_desc: Use image node_id 5 for calling the KNNAnomalyClassifierRegionTest obj's underlying member method code with example usage: obj.testInvalidParameterSpec() without return types