Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyiricdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioinfo_iric
pyiricdata
Merge requests
!17
Resolve "Allow usage of the Personal Authentication Token (PAT)"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Allow usage of the Personal Authentication Token (PAT)"
19-allow-usage-of-the-personal-authentication-token-pat
into
master
Overview
0
Commits
8
Pipelines
0
Changes
3
Merged
Geneviève Boucher
requested to merge
19-allow-usage-of-the-personal-authentication-token-pat
into
master
4 years ago
Overview
0
Commits
8
Pipelines
0
Changes
1
Expand
Closes
#19 (closed)
Edited
4 years ago
by
Geneviève Boucher
0
0
Merge request reports
Compare
version 1
version 2
dcd4ea41
4 years ago
version 1
d92424d2
4 years ago
master (base)
and
version 2
latest version
259af21a
8 commits,
4 years ago
version 2
dcd4ea41
6 commits,
4 years ago
version 1
d92424d2
5 commits,
4 years ago
Show latest version
1 file
+
18
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
test_client.py
+
18
−
4
Options
@@ -51,33 +51,45 @@ class TestClient(unittest.TestCase):
self
.
assertEqual
(
list
(
files_t
.
index
),
list
(
files_a
.
index
))
def
test_datafile_get_ann
(
self
):
"""
Test the retrieval of annotation for a file
"""
dataset_id
=
self
.
client_token
.
datasets
.
index
[
0
]
files_i
=
self
.
client_token
.
get_datafiles_list
(
dataset_id
=
dataset_id
)
annotation
=
self
.
client_token
.
get_file_annotation
(
files_i
.
index
[
0
])
self
.
assertIsInstance
(
annotation
,
dict
)
@unittest.skip
(
'
Skip this test
'
)
def
test_dataset_filter
(
self
):
"""
Test that the retrieval of a specific dataset using its name
"""
# Specific dataset - won't work for everyone
dataset
=
self
.
client_token
.
filter_datasets
(
'
Test
'
)
dataset_id
=
dataset
.
index
[
0
]
self
.
assertEqual
(
dataset_id
,
"
DSB6D767D2
"
)
def
test_dataset_get_files_ann
(
self
):
"""
Test the retrieval of a file by annotation key and value
"""
# Get dataset info
#dataset = self.client_token.filter_datasets('Test')
dataset_id
=
self
.
client_token
.
datasets
.
index
[
0
]
# Get File and its annotation
files_i
=
self
.
client_token
.
get_datafiles_list
(
dataset_id
=
dataset_id
)
file_id
=
files_i
.
index
[
1
]
annotation
=
self
.
client_token
.
get_file_annotation
(
file_id
)
key
,
value
=
list
(
annotation
.
items
())[
0
]
# Test
method from an annotation query
# Test
that the file id is in the list of files retrieved by key:value
files_t
=
self
.
client_token
.
get_datafiles_list
(
key_anno
=
key
,
value_anno
=
value
)
self
.
assertTrue
(
file_id
in
list
(
files_t
.
index
))
@unittest.skip
(
'
Skip this test
'
)
def
test_wrong_dataset_id
(
self
):
"""
Test using a wrong dataset id
"""
dataset_id
=
'
DS00001
'
files_t
=
self
.
client_token
.
get_datafiles_list
(
dataset_id
=
dataset_id
)
self
.
assertTrue
(
len
(
files_t
)
==
0
)
@@ -85,4 +97,6 @@ class TestClient(unittest.TestCase):
if
__name__
==
'
__main__
'
:
unittest
.
main
()
Loading