Skip to content

Commit

Permalink
Merge pull request #3 from Gusgus01/63-trackerevent_str_error
Browse files Browse the repository at this point in the history
63 trackerevent str error update
  • Loading branch information
StoicLoofah authored Nov 1, 2018
2 parents 59987e9 + 5cdfad1 commit a66278d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ my-steps: &steps
- checkout
- run: sudo pip install -r requirements.txt
- run: sudo pip install flake8 pytest
- run: python --version ; pip --version ; pwd ; ls
- run: python --version ; pip --version ; pwd ; ls -l
# stop the build if there are Python syntax errors or undefined names
- run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
Expand All @@ -14,19 +14,19 @@ my-steps: &steps
- run: python -m unittest discover test_replays

jobs:
Python_2.7:
Python2:
docker:
- image: circleci/python:2.7
- image: circleci/python:2.7.15
steps: *steps

Python_3.6:
Python3:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.7
steps: *steps

workflows:
version: 2
build:
jobs:
- Python_2.7
- Python_3.6
- Python2
- Python3
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
============

1.2.0 - October 7, 2018
-----------------------
* Added support for Tychus
* Verified that StarCraft 4.6.1 replays work

1.1.0 - June 26, 2018
---------------------
* Added support for protocol 65895 (StarCraft 4.4.0)
Expand Down
1 change: 1 addition & 0 deletions sc2reader/data/attributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@
"Rayn": "Raynor",
"Stuk": "Stukov",
"Swan": "Swann",
"Tych": "Tychus",
"Vora": "Vorazun",
"Zaga": "Zagara"
}
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
setuptools.setup(
license="MIT",
name="sc2reader",
version='1.1.0',
version='1.2.0',
keywords=["starcraft 2", "sc2", "replay", "parser"],
description="Utility for parsing Starcraft II replay files",
long_description=open("README.rst").read()+"\n\n"+open("CHANGELOG.rst").read(),
Expand All @@ -23,10 +23,11 @@
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Games/Entertainment",
Expand Down
14 changes: 14 additions & 0 deletions test_replays/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import unittest2 as unittest
else:
import unittest
# StringIO was changed in python 3
try:
from io import StringIO
except ImportError:
from StringIO import StringIO

import sc2reader
from sc2reader.exceptions import CorruptTrackerFileError
Expand Down Expand Up @@ -582,6 +587,15 @@ def test_65895(self):
factory = sc2reader.factories.SC2Factory()
replay = factory.load_replay(replayfilename)

def test_event_print(self):
replay = sc2reader.load_replay("test_replays/lotv/lotv1.SC2Replay")
with StringIO() as capturedOutput:
sys.stdout = capturedOutput
for event in replay.events:
print(event)
self.assertIn("PlayerLeaveEvent", capturedOutput.getvalue())
sys.stdout = sys.__stdout__


class TestGameEngine(unittest.TestCase):
class TestEvent(object):
Expand Down

0 comments on commit a66278d

Please sign in to comment.