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
616051b0
Commit
616051b0
authored
Jun 16, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Add tesf for Base_getComputerToken
parent
11de3988
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+36
-0
No files found.
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
616051b0
...
...
@@ -800,6 +800,42 @@ class TestBase_getCredentialToken(TestSlapOSHalJsonStyleMixin):
self
.
assertIn
(
"%s-"
%
(
DateTime
().
strftime
(
"%Y%m%d"
))
,
token_dict
[
'access_token'
])
self
.
login
()
token
=
self
.
portal
.
access_token_module
[
token_dict
[
'access_token'
]]
self
.
assertTrue
(
token
.
getUrlString
().
endswith
(
"Person_getCertificate"
))
self
.
assertEqual
(
token
.
getAgentValue
(),
person
)
self
.
assertEqual
(
"One Time Restricted Access Token"
,
token
.
getPortalType
())
class
TestBase_getComputerToken
(
TestSlapOSHalJsonStyleMixin
):
def
test_Base_getComputerToken
(
self
):
person
=
self
.
_makePerson
()
base
=
self
.
portal
.
web_site_module
.
hostingjs
self
.
login
(
person
.
getUserId
())
token_dict
=
json
.
loads
(
base
.
Base_getComputerToken
())
self
.
assertSameSet
(
token_dict
.
keys
(),
[
'access_token'
,
'command_line'
,
'slapos_master_web'
,
'slapos_master_api'
])
self
.
assertEqual
(
token_dict
[
'command_line'
],
"wget https://deploy.erp5.net/slapos ; bash slapos"
)
self
.
assertIn
(
"%s-"
%
(
DateTime
().
strftime
(
"%Y%m%d"
))
,
token_dict
[
'access_token'
])
self
.
assertEqual
(
token_dict
[
'slapos_master_api'
],
"https://slap.vifib.com"
)
self
.
assertEqual
(
token_dict
[
'slapos_master_web'
],
base
.
absolute_url
())
self
.
login
()
token
=
self
.
portal
.
access_token_module
[
token_dict
[
"access_token"
]]
self
.
assertIn
(
"/Person_requestComputer"
,
token
.
getUrlString
())
self
.
assertEqual
(
token
.
getAgentValue
(),
person
)
self
.
assertEqual
(
"One Time Restricted Access Token"
,
token
.
getPortalType
())
...
...
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