/
test_actions.py
30 lines (22 loc) · 961 Bytes
/
test_actions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Test suite for actions."""
import pathlib
from unittest import mock
import routing_validator
class TestActions():
"""Test suite for actions."""
test_dir = pathlib.Path('/tmp/test/charm-advanced-routing')
test_script = 'test-script'
def test_action_apply_changes_apply_config(self, advanced_routing_helper):
"""Test action apply changes."""
import actions.apply_changes
def noop():
pass
test_obj = advanced_routing_helper
test_obj.common_location = self.test_dir
test_obj.routing_script_name = self.test_script
test_obj.common_ifup_path = self.test_dir / 'if-up' / self.test_script
test_obj.common_cleanup_path = self.test_dir / 'cleanup' / self.test_script
test_obj.post_setup = noop
routing_validator.RoutingConfigValidator.__init__ = mock.Mock(return_value=None)
test_obj.setup()
assert actions.apply_changes.apply_config()