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
Paul Graydon
slapos.core
Commits
7950da2e
Commit
7950da2e
authored
Feb 07, 2024
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: update style skins tests
parent
67e775b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
21 deletions
+12
-21
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+12
-21
No files found.
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
7950da2e
...
...
@@ -41,20 +41,11 @@ def fakeDestroyRequestedSlapState():
class
TestSlapOSHalJsonStyleMixin
(
SlapOSTestCaseMixinWithAbort
):
def
getMonitorUrl
(
self
,
context
,
instance_tree_title
=
None
):
base_url
=
'https://monitor.app.officejs.com/#/?page=ojsm_landing'
instance_tree
=
context
try
:
def
getMonitorUrl
(
self
,
context
):
if
context
.
getPortalType
()
in
[
"Software Instance"
,
"Slave Instance"
]:
instance_tree
=
context
.
getSpecialise
()
connection_parameter_dict
=
instance_tree
.
InstanceTree_getMonitorParameterDict
()
connection_url
=
'&url=%s'
%
connection_parameter_dict
[
'url'
]
+
'&username=%s'
%
connection_parameter_dict
[
'username'
]
+
'&password=%s'
%
connection_parameter_dict
[
'password'
]
except
(
AttributeError
,
TypeError
)
as
_
:
connection_url
=
''
if
context
.
getPortalType
()
==
"Instance Tree"
:
return
base_url
+
'&query=portal_type:"Instance Tree" AND title:"%s"'
%
context
.
getTitle
()
+
connection_url
return
'https://monitor.app.officejs.com/#/?query=portal_type%3A%22Software%20Instance%22%20AND%20title%3A%22Template%20Software%20Instance%22%20AND%20specialise_title%3A%22Template%20Instance%20Tree%22&page=ojsm_landing'
else
:
return
base_url
+
'&query=portal_type:"Software Instance" AND title:"%s" AND '
%
context
.
getTitle
()
+
'specialise_title:"%s"'
%
instance_tree_title
+
connection_url
return
'https://monitor.app.officejs.com/#/?query=portal_type%3A%22Instance%20Tree%22%20AND%20title%3A%22Template%20Instance%20Tree%22&page=ojsm_landing'
maxDiff
=
None
def
afterSetUp
(
self
):
...
...
@@ -245,7 +236,7 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
'portal_type'
:
instance
.
getPortalType
(),
'reference'
:
instance
.
getReference
(),
'since'
:
self
.
created_at
,
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
),
'state'
:
''
,
'text'
:
'#error no data found for %s'
%
instance
.
getReference
(),
'user'
:
'SlapOS Master'
}]
...
...
@@ -291,7 +282,7 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
'portal_type'
:
instance0
.
getPortalType
(),
'reference'
:
instance0
.
getReference
(),
'since'
:
self
.
created_at
,
'monitor_url'
:
self
.
getMonitorUrl
(
instance0
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance0
),
'state'
:
''
,
'text'
:
'#error no data found for %s'
%
instance0
.
getReference
(),
'user'
:
'SlapOS Master'
},
...
...
@@ -300,7 +291,7 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
'portal_type'
:
instance
.
getPortalType
(),
'reference'
:
instance
.
getReference
(),
'since'
:
self
.
created_at
,
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
),
'state'
:
''
,
'text'
:
'#error no data found for %s'
%
instance
.
getReference
(),
'user'
:
'SlapOS Master'
}]}
...
...
@@ -321,7 +312,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
'no_data_since_5_minutes'
:
0
,
'portal_type'
:
instance
.
getPortalType
(),
'reference'
:
instance
.
getReference
(),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
),
'since'
:
self
.
created_at
,
'state'
:
'start_requested'
,
'text'
:
'#access OK'
,
...
...
@@ -344,7 +335,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
'since'
:
self
.
created_at
,
'state'
:
''
,
'text'
:
'#error no data found for %s'
%
instance
.
getReference
(),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
),
'user'
:
'SlapOS Master'
}
self
.
assertEqual
(
_decode_with_json
(
news_dict
),
...
...
@@ -360,7 +351,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
'reference'
:
instance
.
getReference
(),
'is_slave'
:
1
,
'text'
:
'#nodata is a slave %s'
%
instance
.
getReference
(),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
())
,
'monitor_url'
:
'https://monitor.app.officejs.com/#/?query=portal_type%3A%22Software%20Instance%22%20AND%20title%3A%22Template%20Slave%20Instance%22%20AND%20specialise_title%3A%22Template%20Instance%20Tree%22&page=ojsm_landing'
,
'user'
:
'SlapOS Master'
}
self
.
assertEqual
(
_decode_with_json
(
news_dict
),
_decode_with_json
(
expected_news_dict
))
...
...
@@ -376,7 +367,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
"reference"
:
instance
.
getReference
(),
"user"
:
"SlapOS Master"
,
"text"
:
"#nodata is an stopped instance %s"
%
instance
.
getReference
(),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
),
"is_stopped"
:
1
}
self
.
assertEqual
(
_decode_with_json
(
news_dict
),
...
...
@@ -393,7 +384,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
"reference"
:
instance
.
getReference
(),
"user"
:
"SlapOS Master"
,
"text"
:
"#nodata is an destroyed instance %s"
%
instance
.
getReference
(),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
,
instance_tree
.
getTitle
()
),
'monitor_url'
:
self
.
getMonitorUrl
(
instance
),
"is_destroyed"
:
1
}
self
.
assertEqual
(
_decode_with_json
(
news_dict
),
...
...
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