Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelmsft committed Nov 1, 2022
1 parent 3ce3dbc commit 5899db9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/aaa_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,17 @@ def test_config_aaa_tacacs_delete_yang_validation(self):

result = runner.invoke(config.config.commands["tacacs"].commands["delete"], ["10.10.10.10"], obj=obj)
print(result.exit_code)
print(result.output)
assert result.exit_code != 0
assert "Invalid ip address. Error:" in result.output

@patch("validated_config_db_connector.device_info.is_yang_config_validation_enabled", mock.Mock(return_value=True))
@patch("config.validated_config_db_connector.ValidatedConfigDBConnector.validated_set_entry", mock.Mock(side_effect=ValueError))
@patch("config.main.ConfigDBConnector.get_entry", mock.Mock(return_value={}))
def test_config_aaa_tacacs_add_yang_validation(self):
config.ADHOC_VALIDATION = True
runner = CliRunner()
db = Db()
obj = {'db':db.cfgdb}

result = runner.invoke(config.config.commands["tacacs"].commands["add"], ["10.10.10.10"], obj=obj)
print(result.exit_code)
assert result.exit_code != 0

0 comments on commit 5899db9

Please sign in to comment.