示例#1
0
    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
示例#2
0
 def test_remove_mapping_not_available(self):
     mapper = MockPortMapper()
     manager = PortMapperManager(mappers=[mapper])
     assert manager.remove_mapping(40102, 40102) is False