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.
- Loading branch information
Showing
5 changed files
with
168 additions
and
18 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
], | ||
tests_require=[ | ||
'httmock', | ||
'mock', | ||
], | ||
test_suite='tests', | ||
zip_safe=False, | ||
|
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
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,30 @@ | ||
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)) | ||
|
||
|
||
def test_not_equal(self): | ||
dummy_location_1 = Location(1, 1) | ||
dummy_location_2 = Location(2, 2) | ||
self.assertTrue(dummy_location_1 != dummy_location_2) |
15 changes: 15 additions & 0 deletions
15
aimmo-game/tests/test_simulation/avatar/test_fog_of_war.py
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,15 @@ | ||
from __future__ import absolute_import | ||
|
||
from unittest import TestCase | ||
|
||
from simulation.avatar.fog_of_war import should_partially_fog | ||
|
||
|
||
class TestFogOfWar(TestCase): | ||
def test_should_partially_fog(self): | ||
self.assertFalse(should_partially_fog(no_fog_distance=20, partial_fog_distance=2, x_dist=1, y_dist=10)) | ||
self.assertTrue(should_partially_fog(no_fog_distance=1, partial_fog_distance=2, x_dist=20, y_dist=10)) | ||
|
||
|
||
|
||
|
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