Add delete method in EthernetSwitchStaticMAC in RSD 2.1
Change-Id: I32ee4b01b43bbde83216c7a8116e592fa89a6910
This commit is contained in:
parent
17da19a34d
commit
9720ce2e89
@ -36,8 +36,13 @@ class EthernetSwitchStaticMAC(rsd_lib_base.ResourceBase):
|
||||
mac_address = base.Field("MACAddress")
|
||||
"""The static mac address"""
|
||||
|
||||
def delete(self):
|
||||
"""Delete this static mac address"""
|
||||
self._conn.delete(self._path)
|
||||
|
||||
|
||||
class EthernetSwitchStaticMACCollection(rsd_lib_base.ResourceCollectionBase):
|
||||
|
||||
@property
|
||||
def _resource_type(self):
|
||||
return EthernetSwitchStaticMAC
|
||||
|
@ -52,6 +52,12 @@ class EthernetSwitchStaticMACTestCase(testtools.TestCase):
|
||||
self.assertEqual("00:11:22:33:44:55", self.static_mac_inst.mac_address)
|
||||
self.assertEqual(112, self.static_mac_inst.vlan_id)
|
||||
|
||||
def test_delete(self):
|
||||
self.static_mac_inst.delete()
|
||||
self.static_mac_inst._conn.delete.assert_called_once_with(
|
||||
self.static_mac_inst.path
|
||||
)
|
||||
|
||||
|
||||
class EthernetSwitchStaticMACCollectionTestCase(testtools.TestCase):
|
||||
def setUp(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user