def testToListOf( self ):
      cvtType = cvt.Converter( cvt.toType, float ) 
      converter = cvt.toListOf

      l1 = [ "123", 1234.0, 5 ]
      right = map( float, l1 )
             
      v = converter( l1, cvtType )
      self.assertEqual( right, v, "Incorrect conversion of list." )
      
      v = converter( right, cvtType )
      self.assertEqual( right, v, "Incorrect conversion of floats." )

      v = converter( tuple( l1 ), cvtType )
      self.assertEqual( right, v, "Incorrect conversion of tuples." )
      
      self.assertRaises( Exception, converter, [ "foo bar" ], cvtType,
                         name='value',
                   msg="Invalid string argument should be an error." )
      self.assertRaises( Exception, converter, "foo bar", cvtType, name='value',
                   msg="Invalid non-list argument should be an error." )

   #-----------------------------------------------------------------------
Get the power state from the node.
dataset/ETHPy150Open nasa/mplStyle/mplStyle/types/convert/test/test_toListOf.py/TesttoListOf.testToListOf--crossover with--dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/msftocs/power.py/MSFTOCSPower.get_power_state