Skip to content

Commit

Permalink
reset adhoc validation variable in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelmsft committed Sep 18, 2022
1 parent dd66886 commit 201f005
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/portchannel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_add_portchannel_with_invalid_name_yang_validation(self):


def test_add_portchannel_with_invalid_name_adhoc_validation(self):
config.ADHOC_VALIDATION = True
runner = CliRunner()
db = Db()
obj = {'db':db.cfgdb}
Expand All @@ -44,7 +45,8 @@ def test_add_portchannel_with_invalid_name_adhoc_validation(self):
assert result.exit_code != 0
assert "Error: PortChan005 is invalid!, name should have prefix 'PortChannel' and suffix '<0-9999>'" in result.output

def test_delete_portchannel_with_invalid_name(self):
def test_delete_portchannel_with_invalid_name_adhoc_validation(self):
config.ADHOC_VALIDATION = True
runner = CliRunner()
db = Db()
obj = {'db':db.cfgdb}
Expand All @@ -68,7 +70,8 @@ def test_add_existing_portchannel_again(self):
assert result.exit_code != 0
assert "Error: PortChannel0001 already exists!" in result.output

def test_delete_non_existing_portchannel(self):
def test_delete_non_existing_portchannel_adhoc_validation(self):
config.ADHOC_VALIDATION = True
runner = CliRunner()
db = Db()
obj = {'db':db.cfgdb}
Expand All @@ -81,7 +84,8 @@ def test_delete_non_existing_portchannel(self):
assert "Error: PortChannel0005 is not present." in result.output

@pytest.mark.parametrize("fast_rate", ["False", "True", "false", "true"])
def test_add_portchannel_with_fast_rate(self, fast_rate):
def test_add_portchannel_with_fast_rate_adhoc_validation(self, fast_rate):
config.ADHOC_VALIDATION = True
runner = CliRunner()
db = Db()
obj = {'db':db.cfgdb}
Expand Down

0 comments on commit 201f005

Please sign in to comment.