Skip to content

Commit

Permalink
Fix for pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KanzaLatif committed Jul 22, 2024
1 parent e81892c commit 345ccec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/dhcp_rate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ def test_config_dhcp_rate_add_on_invalid_interface(self):
print(result.output)
assert result.exit_code != 0
assert "Error: etp33 does not exist" 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_mod_entry",
mock.Mock(side_effect=ValueError)
)

def test_config_dhcp_rate_add_del_with_value_error(self):
db = Db()
runner = CliRunner()
Expand All @@ -280,6 +280,7 @@ def test_config_dhcp_rate_add_del_with_value_error(self):
print(result.output)
assert result.output != 0
assert "Ethernet84 invalid or does not exist" in result.output

with pytest.raises(ValueError):
result = runner.invoke(config.config.commands["interface"].commands["dhcp-mitigation-rate"].commands["add"],
["Ethernet72", "65"], obj=db)
Expand Down

0 comments on commit 345ccec

Please sign in to comment.