Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fractalis
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Fractalis
fractalis
Commits
7ba9ca37
There was a problem fetching the pipeline mini graph.
Commit
7ba9ca37
authored
8 years ago
by
Sascha Herzinger
Browse files
Options
Downloads
Patches
Plain Diff
adding data schema
parent
72562bc8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fractalis/data/controller.py
+0
-10
0 additions, 10 deletions
fractalis/data/controller.py
fractalis/data/schema.py
+18
-0
18 additions, 0 deletions
fractalis/data/schema.py
tests/test_data.py
+69
-5
69 additions, 5 deletions
tests/test_data.py
with
87 additions
and
15 deletions
fractalis/data/controller.py
+
0
−
10
View file @
7ba9ca37
...
...
@@ -69,13 +69,3 @@ def get_all_data_state():
data_states
=
[
get_data_by_id
(
data_id
,
wait
)
for
data_id
in
session
[
'
data_ids
'
]]
return
jsonify
(
data_states
),
200
@data_blueprint.route
(
'
/<uuid:data_id>
'
,
methods
=
[
'
DELETE
'
])
def
delete_data
(
data_id
):
session
[
'
data_ids
'
].
remove
(
data_id
)
@data_blueprint.route
(
''
,
methods
=
[
'
DELETE
'
])
def
delete_all_data
():
session
[
'
data_ids
'
]
=
[]
This diff is collapsed.
Click to expand it.
fractalis/data/schema.py
+
18
−
0
View file @
7ba9ca37
create_data_schema
=
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
handler
"
:
{
"
type
"
:
"
string
"
},
"
server
"
:
{
"
type
"
:
"
string
"
},
"
token
"
:
{
"
type
"
:
"
string
"
},
"
descriptors
"
:
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
data_type
"
:
{
"
type
"
:
"
string
"
},
},
"
minProperties
"
:
2
,
"
required
"
:
[
"
data_type
"
]
}
}
},
"
required
"
:
[
"
handler
"
,
"
server
"
,
"
token
"
,
"
descriptors
"
]
}
This diff is collapsed.
Click to expand it.
tests/test_data.py
+
69
−
5
View file @
7ba9ca37
...
...
@@ -69,12 +69,77 @@ class TestData:
]
)))
# POST /
@pytest.fixture
(
scope
=
'
function
'
,
params
=
[
{
'
handler
'
:
''
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[{
"
data_type
"
:
"
foo
"
,
"
concept
"
:
"
GSE1234
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
''
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[{
"
data_type
"
:
"
foo
"
,
"
concept
"
:
"
GSE1234
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
''
,
'
descriptors
'
:
'
[{
"
data_type
"
:
"
foo
"
,
"
concept
"
:
"
GSE1234
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
''
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[{
"
data_type
"
:
"
foo
"
,
"
concept
"
:
"
GSE1234
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[{
"
concept
"
:
"
GSE1234
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[{
"
data_type
"
:
"
foo
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[{
"
data_type
"
:
""
,
"
concept
"
:
"
GSE1234
"
}]
'
},
{
'
handler
'
:
'
test
'
,
'
server
'
:
'
localhost
'
,
'
token
'
:
'
1234567890
'
,
'
descriptors
'
:
'
[]
'
}
])
def
bad_post
(
self
,
test_client
,
request
):
return
lambda
:
test_client
.
post
(
'
/data
'
,
data
=
flask
.
json
.
dumps
(
dict
(
handler
=
request
.
param
[
'
handler
'
],
server
=
request
.
param
[
'
server
'
],
token
=
request
.
param
[
'
token
'
],
descriptors
=
request
.
param
[
'
descriptors
'
]
)))
def
test_bad_POST
(
self
,
bad_post
):
assert
bad_post
().
status_code
==
400
def
test_201_on_small_POST_and_valid_state
(
self
,
test_client
,
small_post
):
rv
=
small_post
(
random
=
False
)
assert
rv
.
status_code
==
201
body
=
flask
.
json
.
loads
(
rv
.
get_data
())
assert
rv
.
status_code
==
201
,
body
assert
len
(
body
[
'
data_ids
'
])
==
1
test_client
.
head
(
'
/data?wait=1
'
)
data_dir
=
os
.
path
.
join
(
app
.
config
[
'
FRACTALIS_TMP_DIR
'
],
'
data
'
)
...
...
@@ -89,8 +154,8 @@ class TestData:
def
test_201_on_big_POST_and_valid_state
(
self
,
test_client
,
big_post
):
rv
=
big_post
(
random
=
False
)
assert
rv
.
status_code
==
201
body
=
flask
.
json
.
loads
(
rv
.
get_data
())
assert
rv
.
status_code
==
201
,
body
assert
len
(
body
[
'
data_ids
'
])
==
3
test_client
.
head
(
'
/data?wait=1
'
)
data_dir
=
os
.
path
.
join
(
app
.
config
[
'
FRACTALIS_TMP_DIR
'
],
'
data
'
)
...
...
@@ -162,8 +227,7 @@ class TestData:
assert
data_obj
[
'
job_id
'
]
assert
data_obj
[
'
file_path
'
]
def
test_many_big_random_POST_and_valid_state
(
self
,
test_client
,
big_post
):
def
test_many_big_random_POST_and_valid_state
(
self
,
test_client
,
big_post
):
N
=
10
data_dir
=
os
.
path
.
join
(
app
.
config
[
'
FRACTALIS_TMP_DIR
'
],
'
data
'
)
for
i
in
range
(
N
):
...
...
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