Commits

Marcin Kasperski  committed 1bbd959

Yet another name change. Function imported into tests should not rather have test n name, nose picks it

  • Participants
  • Parent commits 5f48121

Comments (0)

Files changed (4)

File src/mekk/fics/test_utils/__init__.py

 """
 
 from mekk.fics.test_utils.helpers import \
-    load_file_content, load_testdata_file, assert_dicts_equal, assert_tables_equal
+    load_file_content, load_tstdata_file, assert_dicts_equal, assert_tables_equal

File src/mekk/fics/test_utils/helpers.py

 ## TODO: use pkg_resources instead of hacks below
 
 import pkg_resources
-def load_testdata_file(subdir, name, package="mekk.fics"):
+def load_tstdata_file(subdir, name, package="mekk.fics"):
     """Loads file of given name from given subdir of tests
     directory."""
     # path/tomekk.fics/src

File tests/test_input_processor.py

 from mekk.fics.datatypes.notifications import ChannelTell, GameNote, AttributedTell
 from mekk.fics.datatypes.player import PlayerName, PlayerRating, ResultStats
 from mekk.fics.parsing import fics_parser
-from mekk.fics.test_utils.helpers import load_testdata_file, assert_dicts_equal
+from mekk.fics.test_utils.helpers import load_tstdata_file, assert_dicts_equal
 import logging
 import datetime
 from decimal import Decimal
         self.replies[command_id].append( (command_name, status, command_data) )
 
     def test_input_processor(self):
-        file_text = load_testdata_file('ficsparserdata', 'session-short.transcript')
+        file_text = load_tstdata_file('ficsparserdata', 'session-short.transcript')
         file_lines = file_text.split("\n\r")
         for line in file_lines:
             if 'Starting FICS session as' in line:

File tests/test_parser.py

 from mekk.fics.parsing.reply.list_operations import parse_showlist_reply
 from mekk.fics.parsing.reply.observe import parse_observe_reply, parse_unobserve_reply
 from mekk.fics.parsing.reply_parser import parse_fics_reply
-from mekk.fics.test_utils import load_testdata_file, assert_dicts_equal, assert_tables_equal
+from mekk.fics.test_utils import load_tstdata_file, assert_dicts_equal, assert_tables_equal
 from mekk.fics import errors
 import datetime
 from decimal import Decimal
 FICS_PARSE_DATA_DIR = "ficsparserdata"
 
 def load_parse_data_file(name):
-    return load_testdata_file(FICS_PARSE_DATA_DIR, name)
+    return load_tstdata_file(FICS_PARSE_DATA_DIR, name)
 
 def load_parse_data_file_patching_continuations(name):
     data = load_parse_data_file(name)
             parse_observe_reply,
             "Blah blah")
     def testNormal(self):
-        d = parse_observe_reply( load_testdata_file( 'ficsparserdata', 'observe-normal.lines') )
+        d = parse_observe_reply( load_tstdata_file( 'ficsparserdata', 'observe-normal.lines') )
         self.failUnless(d)
         self.failUnlessEqual(d.game_no, 92)
         self.failUnlessEqual(d.white_name, PlayerName('Motyl'))
         self.failUnless(isinstance(is12, style12.Style12))
         self.failUnlessEqual(str(is12), "<12> rnbqkbnr pppppppp -------- -------- -------- -------- PPPPPPPP RNBQKBNR W -1 1 1 1 1 0 92 Motyl Aretus 0 15 10 39 39 900 900 1 none (0:00) none 0 0 0")
     def testProblematic(self):
-        d = parse_observe_reply( load_testdata_file( 'ficsparserdata', 'observe-spec-norating.lines')  )
+        d = parse_observe_reply( load_tstdata_file( 'ficsparserdata', 'observe-spec-norating.lines')  )
         self.failUnless(d)
         self.failUnlessEqual(d.game_no, 161)
         self.failUnlessEqual(d.white_name, PlayerName('ilmagicoalverman'))
         self.failUnlessEqual(str(is12), "<12> rnbqkbnr pppppppp -------- -------- -------- -------- PPPPPPPP RNBQKBNR W -1 1 1 1 1 0 161 ilmagicoalverman bibibibi 0 15 0 39 39 900 900 1 none (0:00) none 0 0 0")
 
     def testProblematic2(self):
-        d = parse_observe_reply(load_testdata_file( 'ficsparserdata', 'observe-spec-shortrating.lines') )
+        d = parse_observe_reply(load_tstdata_file( 'ficsparserdata', 'observe-spec-shortrating.lines') )
         self.failUnless(d)
         self.failUnlessEqual(d.game_no, 222)
         self.failUnlessEqual(d.white_name, PlayerName('Johnnyp'))
         self.failUnlessEqual(str(is12), "<12> rnbqkbnr pppppppp -------- -------- -------- -------- PPPPPPPP RNBQKBNR W -1 1 1 1 1 0 222 Johnnyp schakeric 0 20 0 39 39 1200 1200 1 none (0:00) none 0 0 0")
 
     def testProblematic3(self):
-        d = parse_observe_reply(load_testdata_file( 'ficsparserdata', 'observe-spec-shortrating-white.lines') )
+        d = parse_observe_reply(load_tstdata_file( 'ficsparserdata', 'observe-spec-shortrating-white.lines') )
         self.failUnless(d)
         self.failUnlessEqual(d.game_no, 221)
         self.failUnlessEqual(d.white_name, PlayerName('GuestMGVG'))
         self.failUnlessEqual(d.game_spec.clock, GameClock(5,5))
 
     def testWild4(self):
-        d = parse_observe_reply(load_testdata_file( 'ficsparserdata', 'observe-wild4.lines') )
+        d = parse_observe_reply(load_tstdata_file( 'ficsparserdata', 'observe-wild4.lines') )
         self.failUnless(d)
         self.failUnlessEqual(d.game_no, 226)
         self.failUnlessEqual(d.white_name, PlayerName('Raph'))