| @@ -89,6 +89,8 @@ class SNMPPower(Power): | |||||
| return await snmpset(self.host, | return await snmpset(self.host, | ||||
| 'pethPsePortAdminEnable.1.%d' % self.port, 'bool', v) | 'pethPsePortAdminEnable.1.%d' % self.port, 'bool', v) | ||||
| async def deactivate(self, brd): | |||||
| return await self.setvalue(False) | |||||
| class TestSNMPWrapper(unittest.IsolatedAsyncioTestCase): | class TestSNMPWrapper(unittest.IsolatedAsyncioTestCase): | ||||
| @patch('asyncio.create_subprocess_exec') | @patch('asyncio.create_subprocess_exec') | ||||
| @@ -171,3 +173,12 @@ class TestSNMPPower(unittest.IsolatedAsyncioTestCase): | |||||
| # calls snmpset w/ the correct args | # calls snmpset w/ the correct args | ||||
| ss.assert_called_with('host', 'pethPsePortAdminEnable.1.5', | ss.assert_called_with('host', 'pethPsePortAdminEnable.1.5', | ||||
| 'bool', True) | 'bool', True) | ||||
| ss.reset_mock() | |||||
| # that when deactivate is called | |||||
| await sp.deactivate(None) | |||||
| # calls snmpset w/ the correct args | |||||
| ss.assert_called_with('host', 'pethPsePortAdminEnable.1.5', | |||||
| 'bool', False) | |||||