@@ -1307,6 +1307,32 @@ def test_operand_incompatible(self, Pout, Pin, C, op):
13071307 with pytest .raises (ValueError , match = "incompatible" ):
13081308 PC = op (P , C )
13091309
1310+ @pytest .mark .parametrize (
1311+ "C, op" , [
1312+ (None , ct .LinearIOSystem .__mul__ ),
1313+ (None , ct .LinearIOSystem .__rmul__ ),
1314+ (None , ct .LinearIOSystem .__add__ ),
1315+ (None , ct .LinearIOSystem .__radd__ ),
1316+ (None , ct .LinearIOSystem .__sub__ ),
1317+ (None , ct .LinearIOSystem .__rsub__ ),
1318+ ])
1319+ def test_operand_badtype (self , C , op ):
1320+ P = ct .LinearIOSystem (
1321+ ct .rss (2 , 2 , 2 , strictly_proper = True ), name = 'P' )
1322+ with pytest .raises (TypeError , match = "Unknown" ):
1323+ op (P , C )
1324+
1325+ def test_neg_badsize (self ):
1326+ # Create a system of unspecified size
1327+ sys = ct .InputOutputSystem ()
1328+ with pytest .raises (ValueError , match = "Can't determine" ):
1329+ - sys
1330+
1331+ def test_bad_signal_list (self ):
1332+ # Create a ystem with a bad signal list
1333+ with pytest .raises (TypeError , match = "Can't parse" ):
1334+ ct .InputOutputSystem (inputs = [1 , 2 , 3 ])
1335+
13101336 def test_docstring_example (self ):
13111337 P = ct .LinearIOSystem (
13121338 ct .rss (2 , 2 , 2 , strictly_proper = True ), name = 'P' )
0 commit comments