Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
11de3988
Commit
11de3988
authored
Jun 15, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Add test for ComputerNetwork_hasComputer and Base_getCredentialToken
parent
67bb6bc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+32
-0
No files found.
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
11de3988
...
...
@@ -770,6 +770,38 @@ class TestComputerNetwork_invalidate(TestSlapOSHalJsonStyleMixin):
network
.
ComputerNetwork_invalidate
()
self
.
assertEqual
(
network
.
getValidationState
(),
"invalidated"
)
class
TestComputerNetwork_hasComputer
(
TestSlapOSHalJsonStyleMixin
):
def
test_ComputerNetwork_hasComputer
(
self
):
network
=
self
.
_makeComputerNetwork
()
self
.
assertEqual
(
json
.
loads
(
network
.
ComputerNetwork_hasComputer
()),
0
)
computer
=
self
.
_makeComputer
()
computer
.
setSubordinationValue
(
network
)
self
.
tic
()
self
.
changeSkin
(
"Hal"
)
self
.
assertEqual
(
json
.
loads
(
network
.
ComputerNetwork_hasComputer
()),
1
)
class
TestBase_getCredentialToken
(
TestSlapOSHalJsonStyleMixin
):
def
test_Base_getCredentialToken
(
self
):
person
=
self
.
_makePerson
()
base
=
self
.
portal
.
web_site_module
.
hostingjs
self
.
assertRaises
(
AttributeError
,
base
.
Base_getCredentialToken
)
self
.
login
(
person
.
getUserId
())
token_dict
=
json
.
loads
(
base
.
Base_getCredentialToken
())
self
.
assertEqual
(
token_dict
.
keys
(),
[
"access_token"
,
"command_line"
])
self
.
assertEqual
(
token_dict
[
'command_line'
],
"slapos configure client"
)
self
.
assertIn
(
"%s-"
%
(
DateTime
().
strftime
(
"%Y%m%d"
))
,
token_dict
[
'access_token'
])
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