File tree 1 file changed +18
-11
lines changed
pyomo/contrib/pyros/tests
1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -558,21 +558,28 @@ def test_positive_int_or_minus_one(self):
558
558
Test positive int or -1 validator works as expected.
559
559
"""
560
560
standardizer_func = positive_int_or_minus_one
561
- self .assertIs (
562
- standardizer_func (1.0 ),
561
+ ans = standardizer_func (1.0 )
562
+ self .assertEqual (
563
+ ans ,
563
564
1 ,
564
- msg = (
565
- f"{ positive_int_or_minus_one .__name__ } "
566
- "does not standardize as expected."
567
- ),
565
+ msg = f"{ positive_int_or_minus_one .__name__ } output value not as expected." ,
566
+ )
567
+ self .assertIs (
568
+ type (ans ),
569
+ int ,
570
+ msg = f"{ positive_int_or_minus_one .__name__ } output type not as expected." ,
568
571
)
572
+
573
+ ans = standardizer_func (- 1.0 )
569
574
self .assertEqual (
570
- standardizer_func ( - 1.00 ) ,
575
+ ans ,
571
576
- 1 ,
572
- msg = (
573
- f"{ positive_int_or_minus_one .__name__ } "
574
- "does not standardize as expected."
575
- ),
577
+ msg = f"{ positive_int_or_minus_one .__name__ } output value not as expected." ,
578
+ )
579
+ self .assertIs (
580
+ type (ans ),
581
+ int ,
582
+ msg = f"{ positive_int_or_minus_one .__name__ } output type not as expected." ,
576
583
)
577
584
578
585
exc_str = r"Expected positive int or -1, but received value.*"
You can’t perform that action at this time.
0 commit comments