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,696
Issues
1,696
List
Boards
Labels
Service Desk
Milestones
Merge Requests
88
Merge Requests
88
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
0933247d
Commit
0933247d
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
SampleSetList update unit tests
parent
fc95ea04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
server/web2py/applications/vidjil/tests/unit/models/SampleSetList.py
...py/applications/vidjil/tests/unit/models/SampleSetList.py
+7
-12
No files found.
server/web2py/applications/vidjil/tests/unit/models/SampleSetList.py
View file @
0933247d
...
@@ -19,37 +19,32 @@ class SamplesetlistModel(unittest.TestCase):
...
@@ -19,37 +19,32 @@ class SamplesetlistModel(unittest.TestCase):
factory
=
ModelFactory
()
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
=
SampleSetList
(
helper
)
self
.
assertTrue
(
len
(
slist
.
element_ids
)
>
0
,
"The sample set list was not expected to be empty"
)
self
.
assertTrue
(
len
(
slist
)
>
0
,
"The sample set list was not expected to be empty"
)
def
testCreatorNames
(
self
):
def
testCreatorNames
(
self
):
factory
=
ModelFactory
()
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
=
SampleSetList
(
helper
)
slist
.
load_creator_names
()
values
=
slist
.
result
values
=
slist
.
get_values
()
first
=
values
[
0
]
first
=
values
[
0
]
name
=
first
.
creator
name
=
helper
.
get_creator
(
first
)
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
):
factory
=
ModelFactory
()
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
=
SampleSetList
(
helper
)
slist
.
load_permitted_groups
()
value
=
slist
.
result
[
0
]
value
=
slist
.
get_values
()[
0
]
groups
=
helper
.
get_groups
(
value
)
groups
=
value
.
groups
group_list
=
value
.
group_list
self
.
assertFalse
(
groups
==
""
,
"load_permitted_groups didn't load ay groups"
)
self
.
assertFalse
(
groups
==
""
,
"load_permitted_groups didn't load ay groups"
)
self
.
assertFalse
(
group_list
==
[],
"load_permitted_groups found groups although the group_list is empty"
)
def
testAnonPermissions
(
self
):
def
testAnonPermissions
(
self
):
factory
=
ModelFactory
()
factory
=
ModelFactory
()
helper
=
factory
.
get_instance
(
type
=
'patient'
)
helper
=
factory
.
get_instance
(
type
=
'patient'
)
slist
=
SampleSetList
(
helper
)
slist
=
SampleSetList
(
helper
)
slist
.
load_anon_permissions
()
value
=
slist
.
result
[
0
]
value
=
slist
.
get_values
()[
0
]
self
.
assertFalse
(
value
.
anon_allowed
,
"Anon was allowed, when it was not expected to be"
)
self
.
assertFalse
(
value
.
has_permission
,
"Anon was allowed, when it was not expected to be"
)
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