From: Michael Orlitzky Date: Mon, 23 Feb 2015 16:17:01 +0000 (-0500) Subject: Add a test for Odds_XML-long-import.xml and remove it from the TODO. X-Git-Tag: 0.2.2~1 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhtsn-import.git;a=commitdiff_plain;h=073bbfba4165d4c01d29daaa7523c35c6cc7d114 Add a test for Odds_XML-long-import.xml and remove it from the TODO. --- diff --git a/doc/TODO b/doc/TODO index df8588b..6748d67 100644 --- 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): @@ -42,10 +39,13 @@ * 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. diff --git a/src/TSN/XML/Odds.hs b/src/TSN/XML/Odds.hs index a07f430..5bdf2ba 100644 --- a/src/TSN/XML/Odds.hs +++ b/src/TSN/XML/Odds.hs @@ -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