]> gitweb.michael.orlitzky.com - dead/htsn-import.git/commitdiff
Add a test for Odds_XML-long-import.xml and remove it from the TODO.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 23 Feb 2015 16:17:01 +0000 (11:17 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 23 Feb 2015 16:17:01 +0000 (11:17 -0500)
doc/TODO
src/TSN/XML/Odds.hs

index df8588b2094e57bbee207b30b24a926c3380ce38..6748d67eda3c889b741e661f556052fde24dbb53 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,12 +1,9 @@
-1. Write a test for test/xml/Odds_XML-long-import.xml once it no
-   longer takes 10 minutes to import (Postgres only?).
-
-2. We have DTDs but no sample XML for the following SportInfo types,
+1. We have DTDs but no sample XML for the following SportInfo types,
    which have therefore been left unimplmented for now:
 
    * CBASK_StealsXML.dtd
 
-3. The following DTD types were handled (in some form) by the old
+2. The following DTD types were handled (in some form) by the old
    FeedGrabber. They are not yet handled by htsn-import (some may not
    be valid):
 
    * WNBA_Individual_Stats_XML
    * WNBATeamScheduleXML
 
-4. Consolidate all of the make_game_time functions which take a
+3. Consolidate all of the make_game_time functions which take a
    date/time and produce a combined time.
 
-5. Factor out test code where possible; a lot of them differ only in
+4. Factor out test code where possible; a lot of them differ only in
    the filename.
 
-6. Combine test XML files where possible.
+5. Combine test XML files where possible. We don't need to e.g. import
+   two copies of newsxml just because one has an empty attribute that
+   we want to test: we could just delete an attribute from the first
+   file.
index a07f4308c34d85e6205cb4a4b8f84d44162a4d33..5bdf2ba702a5d04f65248cef505cb5d5680f7631 100644 (file)
@@ -809,7 +809,10 @@ test_pickle_of_unpickle_is_identity = testGroup "pickle-unpickle tests"
           "test/xml/Odds_XML-tba-game-time.xml",
 
     check "pickle composed with unpickle is the identity (empty casino)"
-          "test/xml/Odds_XML-empty-casino.xml" ]
+          "test/xml/Odds_XML-empty-casino.xml",
+
+    check "pickle composed with unpickle is the identity (long import)"
+          "test/xml/Odds_XML-long-import.xml" ]
   where
     check desc path = testCase desc $ do
       (expected, actual) <- pickle_unpickle pickle_message path
@@ -842,7 +845,10 @@ test_unpickle_succeeds = testGroup "unpickle tests"
           "test/xml/Odds_XML-tba-game-time.xml",
 
     check "unpickling succeeds (empty casino)"
-          "test/xml/Odds_XML-empty-casino.xml" ]
+          "test/xml/Odds_XML-empty-casino.xml",
+
+    check "unpickling succeeds (long-import)"
+          "test/xml/Odds_XML-long-import.xml" ]
   where
     check desc path = testCase desc $ do
       actual <- unpickleable path pickle_message
@@ -889,6 +895,10 @@ test_on_delete_cascade = testGroup "cascading delete tests"
     check "deleting odds deleted its children (empty casino)"
           "test/xml/Odds_XML-empty-casino.xml"
           11 -- 5 casinos, 6 teams
+    ,
+    check "deleting odds deleted its children (long import)"
+          "test/xml/Odds_XML-long-import.xml"
+          219 -- 5 casinos, 214 teams
     ]
   where
     check desc path expected = testCase desc $ do