def IpForwardingUtils(self, logger, proto_id=None): """Get system IP address configuration utilities. Args: logger: logger object, used to write to SysLog and serial port. proto_id: string, the routing protocol identifier for Google IP changes. """ return ip_forwarding_utils.IpForwardingUtilsIproute(logger, proto_id)
def setUp(self): self.mock_logger = mock.Mock() self.options = {'hello': 'world'} with mock.patch( 'google_compute_engine.distro_lib.ip_forwarding_utils' '.subprocess') as mock_subprocess: mock_subprocess.Popen.return_value = _CreateMockProcess( 0, b'out', b'') self.mock_utils = ip_forwarding_utils.IpForwardingUtilsIproute( self.mock_logger) self.mock_utils.proto_id = 'proto'