Mercurial > nagslang
changeset 685:7ad528f7d17c
Flesh out mock objects for puzzle tests
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Wed, 11 Sep 2013 16:35:41 +0200 |
parents | f3e79d6225b5 |
children | ffac68f1c5ce |
files | nagslang/tests/test_puzzle.py |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/nagslang/tests/test_puzzle.py Wed Sep 11 16:35:18 2013 +0200 +++ b/nagslang/tests/test_puzzle.py Wed Sep 11 16:35:41 2013 +0200 @@ -4,9 +4,15 @@ from nagslang import puzzle +class FakeBody(object): + def __init__(self): + self.position = (0, 0) + + class FakeShape(object): def __init__(self, collision_type=COLLISION_TYPE_OTHER): self.collision_type = collision_type + self.body = FakeBody() class FakeSpace(object): @@ -16,6 +22,14 @@ def shape_query(self, shape): return self._shapes + def _get_shapes(self): + return self._shapes + + def point_query(self, position): + return [] + + shapes = property(_get_shapes) + class FakeGameObject(object): def __init__(self, shape, space):