Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DataCatalog
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
eFlows4HPC WP2
DataCatalog
Commits
381d40d2
Commit
381d40d2
authored
3 years ago
by
Jedrzej Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
getList should return list
parent
bc76e55c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#68744
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apiserver/storage/JsonFileStorageAdapter.py
+2
-2
2 additions, 2 deletions
apiserver/storage/JsonFileStorageAdapter.py
tests/storage_tests/test_jsonbackend.py
+1
-1
1 addition, 1 deletion
tests/storage_tests/test_jsonbackend.py
with
3 additions
and
3 deletions
apiserver/storage/JsonFileStorageAdapter.py
+
2
−
2
View file @
381d40d2
...
...
@@ -29,12 +29,12 @@ class JsonFileStorageAdapter(AbstractLocationDataStorageAdapter):
if
not
(
os
.
path
.
exists
(
self
.
data_dir
)
and
os
.
path
.
isdir
(
self
.
data_dir
)):
raise
Exception
(
'
Data Directory
\"
'
+
self
.
data_dir
+
'
\"
does not exist.
'
)
def
getList
(
self
,
type
:
LocationDataType
):
def
getList
(
self
,
type
:
LocationDataType
)
->
List
:
localpath
=
os
.
path
.
join
(
self
.
data_dir
,
type
.
value
)
if
not
(
os
.
path
.
isdir
(
localpath
)):
# This type has apparently not yet been used at all, create its directory and return an empty json file
os
.
mkdir
(
localpath
)
return
{}
return
[]
else
:
allFiles
=
[
f
for
f
in
os
.
listdir
(
localpath
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
localpath
,
f
))]
# now each file has to be checked for its filename (= id) and the LocationData name (which is inside the json)
...
...
This diff is collapsed.
Click to expand it.
tests/storage_tests/test_jsonbackend.py
+
1
−
1
View file @
381d40d2
...
...
@@ -25,5 +25,5 @@ class SomeTests(unittest.TestCase):
def
test_getList
(
self
):
test_type
=
LocationDataType
.
DATASET
lst
=
self
.
store
.
getList
(
type
=
test_type
)
self
.
assertEqual
(
lst
,
{},
'
Id should not be none
'
)
self
.
assertEqual
(
lst
,
[],
'
Id should not be none
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment