Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
haskell-gargantext
Commits
12910164
Commit
12910164
authored
Jun 27, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/360-dev-tsv-test' into dev
parents
f246fa1c
d0f47d30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
simple.tsv
test-data/ngrams/simple.tsv
+0
-0
UpdateList.hs
test/Test/API/UpdateList.hs
+5
-5
No files found.
test-data/ngrams/simple.
c
sv
→
test-data/ngrams/simple.
t
sv
View file @
12910164
File moved
test/Test/API/UpdateList.hs
View file @
12910164
...
...
@@ -189,7 +189,7 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
describe
"POST /api/v1.0/lists/:id/csv/add/form/async (CSV)"
$
do
it
"parses CSV via ngramsListFromCSVData"
$
\
((
_testEnv
,
_port
),
_app
)
->
do
simpleNgrams
<-
liftIO
(
TIO
.
readFile
=<<
getDataFileName
"test-data/ngrams/simple.
c
sv"
)
simpleNgrams
<-
liftIO
(
TIO
.
readFile
=<<
getDataFileName
"test-data/ngrams/simple.
t
sv"
)
ngramsListFromTSVData
simpleNgrams
`
shouldBe
`
Right
(
Map
.
fromList
[
(
NgramsTerms
,
Versioned
0
$
Map
.
fromList
[
(
NgramsTerm
"abelian group"
,
NgramsRepoElement
1
MapTerm
Nothing
Nothing
(
MSet
mempty
))
...
...
@@ -202,12 +202,12 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
withValidLogin
port
"alice"
(
GargPassword
"alice"
)
$
\
token
->
do
([
listId
]
::
[
NodeId
])
<-
protectedJSON
token
"POST"
(
mkUrl
port
(
"/node/"
<>
build
cId
))
[
aesonQQ
|
{"pn_typename":"NodeList","pn_name":"Testing"}
|]
-- Upload the CSV doc
simpleNgrams
<-
liftIO
(
TIO
.
readFile
=<<
getDataFileName
"test-data/ngrams/simple.
c
sv"
)
simpleNgrams
<-
liftIO
(
TIO
.
readFile
=<<
getDataFileName
"test-data/ngrams/simple.
t
sv"
)
let
tsvFileFormData
=
[
(
T
.
pack
"_wtf_data"
,
simpleNgrams
)
,
(
"_wtf_filetype"
,
"
C
SV"
)
,
(
"_wtf_name"
,
"simple.
c
sv"
)
,
(
"_wtf_filetype"
,
"
T
SV"
)
,
(
"_wtf_name"
,
"simple.
t
sv"
)
]
let
url
=
"/lists/"
<>
fromString
(
show
$
_NodeId
listId
)
<>
"/
c
sv/add/form/async"
let
url
=
"/lists/"
<>
fromString
(
show
$
_NodeId
listId
)
<>
"/
t
sv/add/form/async"
let
mkPollUrl
j
=
"/corpus/"
<>
fromString
(
show
$
_NodeId
listId
)
<>
"/add/form/async/"
+|
_jph_id
j
|+
"/poll?limit=1"
(
j
::
JobPollHandle
)
<-
postJSONUrlEncoded
token
(
mkUrl
port
url
)
(
urlEncodeFormStable
$
toForm
tsvFileFormData
)
j'
<-
pollUntilFinished
token
port
mkPollUrl
j
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment