def test_sand_torch(self): """ A torch attached to a sand block will turn off when the sand block turns on, and vice versa. """ asic = {} sand = PlainBlock((0, 0, 0), blocks["sand"].slot, 0x0) torch = Torch((1, 0, 0), blocks["redstone-torch"].slot, blocks["redstone-torch"].orientation("-x")) sand.connect(asic) torch.connect(asic) sand.status = True torch.update() self.assertFalse(torch.status) sand.status = False torch.update() self.assertTrue(torch.status)
def test_sand_torch_above(self): """ A torch on top of a sand block will turn off when the sand block turns on, and vice versa. """ asic = Asic() sand = PlainBlock((0, 0, 0), blocks["sand"].slot, 0x0) torch = Torch((0, 1, 0), blocks["redstone-torch"].slot, blocks["redstone-torch"].orientation("+y")) sand.connect(asic) torch.connect(asic) sand.status = True torch.update() self.assertFalse(torch.status) sand.status = False torch.update() self.assertTrue(torch.status)