Skip to content

Commit

Permalink
removed errors from test cases for linktype point_to_point
Browse files Browse the repository at this point in the history
  • Loading branch information
kanza-latif committed Jan 24, 2025
1 parent e1fbc8f commit ce88da0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_config_mstp.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ def test_successful_configuration(self, mock_db, monkeypatch):

# Verify database modification
mock_db.cfgdb.mod_entry.assert_called_once_with(
'STP_PORT',
interface_name,
'STP_PORT',
interface_name,
{'link_type': 'point-to-point'}
)

Expand All @@ -855,8 +855,8 @@ def test_stp_disabled_exception(self, mock_db, monkeypatch):

# Patch methods to raise exception for STP not being enabled
monkeypatch.setattr('click.get_current_context', lambda: mock_ctx)
monkeypatch.setattr('__main__.check_if_stp_enabled_for_interface',
lambda *args: exec('raise click.ClickException("STP not enabled")'))
monkeypatch.setattr('__main__.check_if_stp_enabled_for_interface',
lambda *args: exec('raise click.ClickException("STP not enabled")'))

# Prepare test data
interface_name = 'Ethernet1'
Expand All @@ -873,8 +873,8 @@ def test_invalid_interface_exception(self, mock_db, monkeypatch):
# Patch methods to raise exception for invalid interface
monkeypatch.setattr('click.get_current_context', lambda: mock_ctx)
monkeypatch.setattr('__main__.check_if_stp_enabled_for_interface', lambda *args: None)
monkeypatch.setattr('__main__.check_if_interface_is_valid',
lambda *args: exec('raise click.ClickException("Invalid interface")'))
monkeypatch.setattr('__main__.check_if_interface_is_valid',
lambda *args: exec('raise click.ClickException("Invalid interface")'))

# Prepare test data
interface_name = 'InvalidInterface'
Expand Down

0 comments on commit ce88da0

Please sign in to comment.