Remove duplicate test file functions
authorIustin Pop <iustin@google.com>
Wed, 26 Dec 2012 12:52:24 +0000 (13:52 +0100)
committerIustin Pop <iustin@google.com>
Thu, 27 Dec 2012 13:34:44 +0000 (14:34 +0100)
This patch unifies the functions that generated the tree
reorganisation discussion in the first place :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

test/hs/Test/Ganeti/Block/Drbd/Parser.hs
test/hs/Test/Ganeti/TestCommon.hs

index 17b0988..401f1ec 100644 (file)
@@ -43,7 +43,7 @@ import Ganeti.Block.Drbd.Types
 -- | Function for testing whether a file is parsed correctly.
 testFile :: String -> DRBDStatus -> Assertion
 testFile fileName expectedContent = do
-    fileContent <- readPythonTestData fileName
+    fileContent <- readTestData fileName
     case A.parseOnly drbdStatusParser $ pack fileContent of
         Left msg -> assertFailure $ "Parsing failed: " ++ msg
         Right obtained -> assertEqual fileName expectedContent obtained
index 72ae311..6dcc8ad 100644 (file)
@@ -289,14 +289,8 @@ testDataFilename datadir name = do
         src <- getSourceDir
         return $ src ++ datadir ++ name
 
--- | Returns the content of the specified python test data file.
-readPythonTestData :: String -> IO String
-readPythonTestData filename = do
-    name <- testDataFilename "/test/data/" filename
-    readFile name
-
 -- | Returns the content of the specified haskell test data file.
 readTestData :: String -> IO String
 readTestData filename = do
-    name <- testDataFilename "/test/data/htools/" filename
+    name <- testDataFilename "/test/data/" filename
     readFile name