This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First test written for location.py in worker.
- Loading branch information
1 parent
9917074
commit ded992f
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|