Commit 7860c5b2 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/adinapoli/issue-460' into dev-merge

parents 7574fc93 a08e14cc
......@@ -181,8 +181,7 @@ ngramsListFromTSVData tsvData = case decodeTsv of
decodeTsv = Vec.catMaybes <$>
Tsv.decodeWithP tsvToNgramsTableMap
(Tsv.defaultDecodeOptions { Tsv.decDelimiter = fromIntegral (P.ord '\t') })
-- Don't use an header, make it lenient in case the 'forms' are missing.
Tsv.NoHeader
Tsv.HasHeader
binaryData
-- | Converts a plain TSV 'Record' into an NgramsTableMap
......
......@@ -39,9 +39,9 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
describe "Importing terms as TSV" $ do
it "[#381] should work (and return a non-empty list of ngrams" $ \(SpecContext testEnv port app _) -> do
it "should work for TSV with a missing 'forms' column" $ \(SpecContext testEnv port app _) -> do
cId <- newCorpusForUser testEnv "alice"
let log_cfg = (test_config testEnv) ^. gc_logging
let log_cfg = test_config testEnv ^. gc_logging
withApplication app $ do
withValidLogin port "alice" (GargPassword "alice") $ \clientEnv token -> do
([listId] :: [NodeId]) <- protectedJSON token "POST" (mkUrl port ("/node/" <> build cId)) [aesonQQ|{"pn_typename":"NodeList","pn_name":"Testing"}|]
......@@ -50,8 +50,8 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
let params = WithTextFile { _wtf_filetype = FType.TSV
, _wtf_data = simpleNgrams
, _wtf_name = "simple.tsv" }
ji <- checkEither $ liftIO $ runClientM (add_tsv_to_list token listId params) clientEnv
_ <- pollUntilWorkFinished log_cfg port ji
pendingJob <- checkEither $ liftIO $ runClientM (add_tsv_to_list token listId params) clientEnv
_ <- pollUntilWorkFinished log_cfg port pendingJob
-- Now check that we can retrieve the ngrams, and the ngrams list is not empty!
liftIO $ do
......
......@@ -45,7 +45,7 @@ withTwoServerInstances action =
where
server1Port = 8008
server2Port = 9008
log_cfg te = (test_config te) ^. gc_logging
log_cfg te = test_config te ^. gc_logging
tests :: Spec
tests = sequential $ aroundAll withTwoServerInstances $ do
......
......@@ -153,7 +153,7 @@ withBackendServerAndProxy action =
where
proxyPort = 8090
cfg te = test_config te
log_cfg te = (cfg te) ^. gc_logging
log_cfg te = cfg te ^. gc_logging
setupEnvironment :: TestEnv -> IO ()
setupEnvironment env = flip runReaderT env $ runTestMonad $ do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment