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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
gargantext
haskell-gargantext
Commits
598b2bf7
Commit
598b2bf7
authored
Jun 26, 2024
by
Karen Konou
Committed by
Alexandre Delanoë
Jun 27, 2024
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API tests] fix tsv upload
parent
5ec3c2af
Pipeline
#6291
passed with stages
in 26 minutes and 22 seconds
Changes
2
Pipelines
1
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 @
598b2bf7
File moved
test/Test/API/UpdateList.hs
View file @
598b2bf7
...
...
@@ -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
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
5660aec0
·
Oct 08, 2024
mentioned in commit
5660aec0
mentioned in commit 5660aec07ec5a0a0a5468f440092c1a8f57a864e
Toggle commit list
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