Skip to content

Commit

Permalink
Modify CiscoRange() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Oct 20, 2023
1 parent 31b710e commit 7dfbc4b
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions tests/test_Ccp_Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,30 +874,23 @@ def test_CiscoRange_compressed_str_01():
uut_str = "1,2,911"
assert isinstance(uut_str, str)
assert CiscoRange(uut_str, result_type=str).as_compressed_str() == "1,2,911"
assert "1" in CiscoRange(uut_str)
assert "2" in CiscoRange(uut_str)
assert "911" in CiscoRange(uut_str)
assert "2" in CiscoRange(uut_str).as_compressed_str()
assert "911" in CiscoRange(uut_str).as_compressed_str()

def test_CiscoRange_compressed_str_02():
"""compressed_str test with vlan number ranges"""
uut_str = "1,2, 3, 6, 7, 8 , 9, 911"
assert isinstance(uut_str, str)
assert CiscoRange(uut_str, result_type=str).as_compressed_str() == "1-3,6-9,911"
assert "1" in CiscoRange(uut_str)
assert "2" in CiscoRange(uut_str)
assert "3" in CiscoRange(uut_str)
assert "6" in CiscoRange(uut_str)
assert "7" in CiscoRange(uut_str)
assert "8" in CiscoRange(uut_str)
assert "9" in CiscoRange(uut_str)
assert "911" in CiscoRange(uut_str)


def test_CiscoRange_contains():
uut_str = "Ethernet1/1-20"
assert isinstance(uut_str, str)
# Ethernet1/5 is in CiscoRange("Ethernet1/1-20")...
assert "Ethernet1/5" in CiscoRange(uut_str)
assert "1/1" in CiscoRange(uut_str).as_compressed_str()
assert "20" in CiscoRange(uut_str).as_compressed_str()
assert "Ethernet1/5" in CiscoRange(uut_str).as_list()

#pragma warning restore S1192
#pragma warning restore S1313
Expand Down

0 comments on commit 7dfbc4b

Please sign in to comment.