def test_remove_mapping_failure(self): mapper = MockPortMapper(available=True) mapper.remove_mapping = Mock(side_effect=Exception) manager = PortMapperManager(mappers=[mapper]) manager._active_mapper = mapper assert manager.remove_mapping(40102, 40102) is False
def test_remove_mapping_not_available(self): mapper = MockPortMapper() manager = PortMapperManager(mappers=[mapper]) assert manager.remove_mapping(40102, 40102) is False