Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Commits
c3ce20d3
Commit
c3ce20d3
authored
4 years ago
by
Daniel Lyons
Browse files
Options
Downloads
Patches
Plain Diff
Some persistence testing
parent
b3de8c1d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shared/workspaces/test/test_persistence.py
+30
-2
30 additions, 2 deletions
shared/workspaces/test/test_persistence.py
with
30 additions
and
2 deletions
shared/workspaces/test/test_persistence.py
+
30
−
2
View file @
c3ce20d3
from
schema
import
create_session
from
schema
import
create_session
from
workspaces.services
import
WorkflowInfo
from
workspaces.capability_interfaces
import
CapabilityInfoIF
from
workspaces.services
import
WorkflowInfo
,
CapabilityInfo
from
workspaces.workflow_interfaces
import
WorkflowInfoIF
def
get_workflow_info
()
->
WorkflowInfoIF
:
"""
Return a WorkflowInfo based on a real database connection
"""
return
WorkflowInfo
(
create_session
(
"
SDM
"
))
def
get_capability_info
()
->
CapabilityInfoIF
:
"""
Return a CapabilityInfo based on a real database connection
"""
return
CapabilityInfo
(
create_session
(
"
SDM
"
))
def
test_persisting_workflow_request
():
def
test_persisting_workflow_request
():
info
=
WorkflowInfo
(
create_session
(
"
SDM
"
))
"""
Ensure we can persist a workflow request
"""
info
=
get_workflow_info
()
null
=
info
.
lookup_workflow_definition
(
"
null
"
)
null
=
info
.
lookup_workflow_definition
(
"
null
"
)
req
=
info
.
create_workflow_request
(
null
,
{})
req
=
info
.
create_workflow_request
(
null
,
{})
assert
req
.
workflow_request_id
is
not
None
def
test_reading_workflows
():
"""
Ensure we can get workflows
"""
info
=
get_workflow_info
()
workflows
=
info
.
all_workflows
()
assert
len
(
workflows
)
>
0
def
test_reading_capability
():
"""
Ensure we can get a capability
"""
info
=
get_capability_info
()
null
=
info
.
lookup_capability
(
"
null
"
)
assert
null
is
not
None
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