Beispiel #1
0
def test_drawer_blit_simple(pygame):
    drawer = Drawer(Game())
    image = object()
    drawer.IMAGES = {'IMAGE': image}

    drawer._blit('IMAGE', NPC(1, 2))

    drawer.screen.blit.assert_called_once_with(
        image, (drawer.OFFSET + 1, drawer.OFFSET + 2))
Beispiel #2
0
def test_drawer_blit_pack(pygame):
    drawer = Drawer(Game())
    image = object()
    drawer.IMAGES = {'IMAGE': {Direction.DOWN: image}}

    monster = NPC(1, 2)
    monster.set_direction(Direction.DOWN)
    drawer._blit('IMAGE', monster)

    drawer.screen.blit.assert_called_once_with(
        image, (drawer.OFFSET + 1, drawer.OFFSET + 2))