From 184cd3485bb44aa8ebfdf5b75d6e6b24c3bdb9e3 Mon Sep 17 00:00:00 2001 From: mpenning Date: Thu, 2 Nov 2023 13:36:26 -0500 Subject: [PATCH] Add checks for InvalidParameters --- tests/test_CiscoConfParse.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_CiscoConfParse.py b/tests/test_CiscoConfParse.py index 92bb95d..17fb6ab 100644 --- a/tests/test_CiscoConfParse.py +++ b/tests/test_CiscoConfParse.py @@ -165,6 +165,19 @@ def testValues_IOSCfgLine_06(): with pytest.raises(InvalidParameters): parse.insert_before("1") +def testValues_IOSCfgLine_07(): + """test that a bool in the config list and factory=False is rejected with a InvalidParameters()""" + with pytest.raises(InvalidParameters): + parse = CiscoConfParse([False], factory=False) + + with pytest.raises(InvalidParameters): + parse = CiscoConfParse([True], factory=False) + +def testValues_IOSCfgLine_08(): + """test that a bool in the config list and factory=True is rejected with a InvalidParameters()""" + with pytest.raises(InvalidParameters): + parse = CiscoConfParse([False], factory=True) + def testParse_f5_as_ios_00(parse_f01_ios): assert len(parse_f01_ios.objs)==20