Delete job related tests
This commit is contained in:
1 parent
7d6fc8aa81
commit
971b98acde
21 files changed
+261
-3152
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import unittest
|
||||
from munch import Munch
|
||||
|
||||
from mosfet.info import blocks, mobs
|
||||
from mosfet.world import World
|
||||
|
||||
|
||||
class FakeChunks:
|
||||
def __init__(self, solid=()):
|
||||
self.solid = set(solid)
|
||||
|
||||
def get_block_at(self, x, y, z):
|
||||
return blocks.STONE if (x, y, z) in self.solid else blocks.AIR
|
||||
|
||||
|
||||
class WorldThreatTests(unittest.TestCase):
|
||||
def test_find_threats_filters_passive_and_distant_entities(self):
|
||||
zombie = mobs.MOBS['minecraft:zombie']['protocol_id']
|
||||
villager = mobs.MOBS['minecraft:villager']['protocol_id']
|
||||
world = World(Munch(mobs={
|
||||
1: Munch(entity_id=1, type=zombie, x=3.2, y=64, z=0),
|
||||
2: Munch(entity_id=2, type=villager, x=2, y=64, z=0),
|
||||
3: Munch(entity_id=3, type=zombie, x=30, y=64, z=0),
|
||||
}))
|
||||
world.check_air_column = lambda pos, distance: True
|
||||
|
||||
result = world.find_threats((0, 64, 0), 12)
|
||||
|
||||
self.assertEqual([threat.entity_id for threat in result], [1])
|
||||
|
||||
def test_air_column_excludes_mobs_under_a_solid_roof(self):
|
||||
world = World(Munch(chunks=FakeChunks(solid={(0, 67, 0)})))
|
||||
self.assertFalse(world.check_air_column((0, 64, 0), 5))
|
||||
self.assertTrue(world.check_air_column((2, 64, 0), 5))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user