Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
First test written for location.py in worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafSzmidt committed Sep 4, 2017
1 parent 9917074 commit ded992f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions aimmo-game-worker/tests/simulation/test_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from __future__ import absolute_import

from unittest import TestCase

from simulation.location import Location


class TestLocation(TestCase):

def test_add(self):
dummy_location = Location(1, 2)
direction = Location(1, 1)
expected = Location(2, 3)
self.assertEqual(dummy_location + direction, expected)

def test_sub(self):
dummy_location = Location(3, 2)
direction = Location(1, 1)
expected = Location(2, 1)
self.assertEqual(dummy_location - direction, expected)

def test_repr(self):
dummy_location = Location(1, 2)
self.assertTrue("Location(1, 2)" == str(dummy_location))







0 comments on commit ded992f

Please sign in to comment.