Add delete method in EthernetSwitchACLRule in RSD 2.1

Change-Id: I6ae5898688d923035ff2f9847d12d3bde3c9060a
This commit is contained in:
Lin Yang 2019-03-26 20:22:02 -07:00
parent ee8adbbb1d
commit af3d36dd31
2 changed files with 10 additions and 0 deletions

View File

@ -95,6 +95,10 @@ class EthernetSwitchACLRule(rsd_lib_base.ResourceBase):
action.
"""
def delete(self):
"""Delete this ACL rule"""
self._conn.delete(self._path)
@property
@utils.cache_it
def forward_mirror_interface(self):

View File

@ -72,6 +72,12 @@ class EthernetSwitchACLRuleTestCase(testtools.TestCase):
None, self.acl_rule_inst.condition.l4_destination_port
)
def test_delete(self):
self.acl_rule_inst.delete()
self.acl_rule_inst._conn.delete.assert_called_once_with(
self.acl_rule_inst.path
)
def test_forward_mirror_interface(self):
# | GIVEN |
self.conn.get.return_value.json.reset_mock()