Skip to content

Commit 0010b91

Browse files
committed
Localize the plugin registration for now, don't require a cache.
1 parent 06608c6 commit 0010b91

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

test_replays/test_all.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,9 @@
99

1010
import sc2reader
1111
from sc2reader.exceptions import ParseError
12-
from sc2reader.plugins.replay import APMTracker, SelectionTracker
12+
from sc2reader.plugins.replay import APMTracker, SelectionTracker, toJSON
1313

1414
sc2reader.log_utils.log_to_console('INFO')
15-
# Tests for build 17811 replays
16-
17-
class SC2TestFactory(sc2reader.factories.DoubleCachedSC2Factory):
18-
def __init__(self, cache_dir, max_cache_size=0, **options):
19-
"""cache_dir must be an absolute path, max_cache_size=0 => unlimited"""
20-
if not cache_dir:
21-
raise ValueError("cache_dir is now required.")
22-
23-
super(SC2TestFactory, self).__init__(cache_dir, max_cache_size, **options)
24-
25-
self.register_plugin('Replay',APMTracker())
26-
self.register_plugin('Replay',SelectionTracker())
27-
2815

2916
def test_standard_1v1():
3017
replay = sc2reader.load_replay("test_replays/1.2.2.17811/1.SC2Replay")
@@ -266,7 +253,9 @@ def test_cn_replays():
266253
assert replay.expansion == 'WoL'
267254

268255
def test_plugins():
269-
CACHE_DIR = os.environ.get('GGFACTORY_CACHE_DIR',None)
270-
factory = SC2TestFactory(cache_dir=CACHE_DIR)
256+
factory = sc2reader.factories.SC2Factory()
257+
factory.register_plugin('Replay',APMTracker())
258+
factory.register_plugin('Replay',SelectionTracker())
259+
factory.register_plugin('Replay',toJSON())
271260
replay = factory.load_replay("test_replays/2.0.5.25092/cn1.SC2Replay")
272261

0 commit comments

Comments
 (0)