Skip to content

Commit

Permalink
Fix imports in circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
sjohnson31 committed Nov 22, 2019
1 parent b78e6f0 commit 467d5bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Expand Up @@ -14,6 +14,8 @@ jobs:
command: |
python -m venv venv
. ./venv/bin/activate
PYTHONPATH=./src/:$PYTHONPATH
export PYTHONPATH
- run:
name: Install Deps
command: pip install -r requirements.txt
Expand Down
3 changes: 3 additions & 0 deletions api/tests/__init__.py
@@ -0,0 +1,3 @@
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src')))
16 changes: 8 additions & 8 deletions api/tests/test_game_state_server.py
@@ -1,4 +1,4 @@
from src.game_state_server import GameStateServer, Token
import game_state_server as gss


test_token = {
Expand All @@ -14,22 +14,22 @@


def test_validate_token():
valid_token = Token(**test_token)
assert GameStateServer.is_valid_token(valid_token) is True
valid_token = gss.Token(**test_token)
assert gss.GameStateServer.is_valid_token(valid_token) is True

invalid_token = Token(**test_token)
invalid_token = gss.Token(**test_token)
invalid_token.start_x = 2
assert GameStateServer.is_valid_token(invalid_token) is False
assert gss.GameStateServer.is_valid_token(invalid_token) is False


def test_get_unit_blocks():
valid_token = Token(**test_token)
assert GameStateServer.get_unit_blocks(valid_token) == [(0, 0, 0)]
valid_token = gss.Token(**test_token)
assert gss.GameStateServer.get_unit_blocks(valid_token) == [(0, 0, 0)]

valid_token.end_x = 2
valid_token.end_y = 2
valid_token.end_z = 2
blocks = GameStateServer.get_unit_blocks(valid_token)
blocks = gss.GameStateServer.get_unit_blocks(valid_token)
assert (0, 0, 0) in blocks
assert (1, 0, 0) in blocks
assert (0, 1, 0) in blocks
Expand Down

0 comments on commit 467d5bb

Please sign in to comment.