def test__dpdk_execute_failure(self): conn = mock.Mock() conn.execute = mock.Mock(return_value=(1, 'output', 'error')) conn.provision_tool = mock.Mock(return_value='tool_path') dpdk_bind_helper = DpdkBindHelper(conn) with self.assertRaises(DpdkBindHelperException): dpdk_bind_helper._dpdk_execute('command')
def test__dpdk_execute(self): conn = mock.Mock() conn.execute = mock.Mock(return_value=(0, 'output', 'error')) conn.provision_tool = mock.Mock(return_value='tool_path') dpdk_bind_helper = DpdkBindHelper(conn) self.assertEqual((0, 'output', 'error'), dpdk_bind_helper._dpdk_execute('command'))