Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,688
Issues
1,688
List
Boards
Labels
Service Desk
Milestones
Merge Requests
84
Merge Requests
84
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
aef0e801
Commit
aef0e801
authored
Oct 22, 2020
by
Ryan Herbert
Committed by
Mikaël Salson
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update usages of SampleSetList to use helpers
parent
20d114a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
server/web2py/applications/vidjil/controllers/sample_set.py
server/web2py/applications/vidjil/controllers/sample_set.py
+4
-3
server/web2py/applications/vidjil/tests/unit/models/SampleSetList.py
...py/applications/vidjil/tests/unit/models/SampleSetList.py
+12
-4
No files found.
server/web2py/applications/vidjil/controllers/sample_set.py
View file @
aef0e801
...
@@ -280,13 +280,14 @@ def stats():
...
@@ -280,13 +280,14 @@ def stats():
search
,
tags
=
parse_search
(
request
.
vars
[
"filter"
])
search
,
tags
=
parse_search
(
request
.
vars
[
"filter"
])
group_ids
=
get_involved_groups
()
group_ids
=
get_involved_groups
()
list
=
SampleSetList
(
type
,
tags
=
tags
)
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
type
)
list
=
SampleSetList
(
helper
,
tags
=
tags
)
list
.
load_sample_information
()
list
.
load_sample_information
()
list
.
load_anon_permissions
()
list
.
load_anon_permissions
()
result
=
list
.
get_values
()
result
=
list
.
get_values
()
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
type
)
fields
=
helper
.
get_reduced_fields
()
fields
=
helper
.
get_reduced_fields
()
##sort result
##sort result
...
...
server/web2py/applications/vidjil/tests/unit/models/SampleSetList.py
View file @
aef0e801
...
@@ -16,11 +16,15 @@ class SamplesetlistModel(unittest.TestCase):
...
@@ -16,11 +16,15 @@ class SamplesetlistModel(unittest.TestCase):
auth
.
login_bare
(
"test@vidjil.org"
,
"123456"
)
auth
.
login_bare
(
"test@vidjil.org"
,
"123456"
)
def
testInit
(
self
):
def
testInit
(
self
):
slist
=
SampleSetList
(
'patient'
)
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
self
.
assertTrue
(
len
(
slist
.
element_ids
)
>
0
,
"The sample set list was not expected to be empty"
)
self
.
assertTrue
(
len
(
slist
.
element_ids
)
>
0
,
"The sample set list was not expected to be empty"
)
def
testCreatorNames
(
self
):
def
testCreatorNames
(
self
):
slist
=
SampleSetList
(
'patient'
)
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
.
load_creator_names
()
slist
.
load_creator_names
()
values
=
slist
.
get_values
()
values
=
slist
.
get_values
()
first
=
values
[
0
]
first
=
values
[
0
]
...
@@ -28,7 +32,9 @@ class SamplesetlistModel(unittest.TestCase):
...
@@ -28,7 +32,9 @@ class SamplesetlistModel(unittest.TestCase):
self
.
assertFalse
(
name
==
""
,
"load_creator_names failed to retrieve a username"
)
self
.
assertFalse
(
name
==
""
,
"load_creator_names failed to retrieve a username"
)
def
testPermittedGroups
(
self
):
def
testPermittedGroups
(
self
):
slist
=
SampleSetList
(
'patient'
)
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
.
load_permitted_groups
()
slist
.
load_permitted_groups
()
value
=
slist
.
get_values
()[
0
]
value
=
slist
.
get_values
()[
0
]
groups
=
value
.
groups
groups
=
value
.
groups
...
@@ -38,7 +44,9 @@ class SamplesetlistModel(unittest.TestCase):
...
@@ -38,7 +44,9 @@ class SamplesetlistModel(unittest.TestCase):
self
.
assertFalse
(
group_list
==
[],
"load_permitted_groups found groups although the group_list is empty"
)
self
.
assertFalse
(
group_list
==
[],
"load_permitted_groups found groups although the group_list is empty"
)
def
testAnonPermissions
(
self
):
def
testAnonPermissions
(
self
):
slist
=
SampleSetList
(
'patient'
)
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
.
load_anon_permissions
()
slist
.
load_anon_permissions
()
value
=
slist
.
get_values
()[
0
]
value
=
slist
.
get_values
()[
0
]
...
...
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