-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: Unittest lib restructuring (#614)
- Loading branch information
Showing
2 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
from tests.data.device_tools_unit import validate_router_bgp, return_validate_config_for_device, validate_intf, validate_true | ||
from unittest.mock import MagicMock | ||
|
||
class MockCvpApi(MagicMock): | ||
def validate_config_for_device(self, device_mac, config): | ||
if config == validate_router_bgp['config']: | ||
return return_validate_config_for_device['return_validate_ruter_bgp'] | ||
if config == validate_intf['config']: | ||
return return_validate_config_for_device['return_validate_intf'] | ||
if config == validate_true['config']: | ||
return return_validate_config_for_device['return_validate_true'] | ||
def validate_config_for_device(device_mac, config): | ||
if config == validate_router_bgp['config']: | ||
return return_validate_config_for_device['return_validate_ruter_bgp'] | ||
if config == validate_intf['config']: | ||
return return_validate_config_for_device['return_validate_intf'] | ||
if config == validate_true['config']: | ||
return return_validate_config_for_device['return_validate_true'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters