def test_add(self):
        prio_set_list = event._PrioritizedSetList()
        objs = [(i,) for i in range(5)]

        prio_set_list.add(0, objs[0])
        assert prio_set_list.list == [(0, {objs[0]})]

        prio_set_list.add(0, objs[1])
        assert prio_set_list.list == [(0, {objs[0], objs[1]})]

        prio_set_list.add(10, objs[2])
        assert prio_set_list.list == [(10, {objs[2]}),
                                      (0,  {objs[0], objs[1]})]

        prio_set_list.add(-10, objs[3])
        assert prio_set_list.list == [( 10, {objs[2]}),           # noqa: E201
                                      (  0, {objs[0], objs[1]}),  # noqa: E201
                                      (-10, {objs[3]})]
        prio_set_list.add(-1, objs[4])
        assert prio_set_list.list == [( 10, {objs[2]}),           # noqa: E201
                                      (  0, {objs[0], objs[1]}),  # noqa: E201
                                      ( -1, {objs[4]}),           # noqa: E201
                                      (-10, {objs[3]})]
def __init__(self, container):
		self.x = container.x+randint(1, floor(container.w/3))
		self.y = container.y+randint(1, floor(container.h/3))
		self.w = container.w-(self.x-container.x)
		self.h = container.h-(self.y-container.y)
		self.w -= randint(0,floor(self.w/3))
		self.h -= randint(0,floor(self.w/3))
		self.environment = int(min(4,10*(container.distance_from_center/MAP_WIDTH)+random()*2-1))
		roll = random()*0.9+(2*container.distance_from_center/MAP_WIDTH)*0.1
		self.biome = next(n for n,b in enumerate(self.biomes_CDF) if roll<b)