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
c919af80
Commit
c919af80
authored
Aug 21, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Add test for SupportRequestModule_getMonitoringUrlList
parent
f6f13590
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+54
-0
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
c919af80
...
@@ -101,6 +101,60 @@ class TestCRMSkinsMixin(SlapOSTestCaseMixinWithAbort):
...
@@ -101,6 +101,60 @@ class TestCRMSkinsMixin(SlapOSTestCaseMixinWithAbort):
return
software_installation
return
software_installation
class
TestSlapOSSupportRequestModule_getMonitoringUrlList
(
TestCRMSkinsMixin
):
def
test_SupportRequestModule_getMonitoringUrlList
(
self
):
module
=
self
.
portal
.
support_request_module
# We assume here that several objects created by others tests don't influentiate
# this test.
self
.
assertEquals
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
hosting_subscription
=
self
.
_makeHostingSubscription
()
self
.
_makeSoftwareInstance
(
hosting_subscription
,
"https://xxx/"
)
support_request
=
module
.
newContent
(
portal_type
=
"Support Request"
)
self
.
tic
()
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
support_request
.
setAggregateValue
(
hosting_subscription
)
support_request
.
validate
()
self
.
assertNotEqual
(
hosting_subscription
.
getPredecessorList
(),
[])
self
.
tic
()
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
instance
=
hosting_subscription
.
getPredecessorValue
()
instance
.
setConnectionXml
(
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="aa">xx</parameter>
<parameter id="bb">yy</parameter>
</instance>
"""
)
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
instance
.
setConnectionXml
(
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="monitor-setup-url">http</parameter>
<parameter id="bb">yy</parameter>
</instance>
"""
)
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
instance
.
setConnectionXml
(
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="monitor-setup-url">http://monitor.url/#/ABC</parameter>
<parameter id="bb">yy</parameter>
</instance>
"""
)
monitor_url_temp_document_list
=
module
.
SupportRequestModule_getMonitoringUrlList
()
self
.
assertEqual
(
len
(
monitor_url_temp_document_list
),
1
)
self
.
assertEqual
(
monitor_url_temp_document_list
[
0
].
getTitle
(),
hosting_subscription
.
getTitle
())
self
.
assertEqual
(
monitor_url_temp_document_list
[
0
].
monitor_url
,
"http://monitor.url/#/ABC"
)
support_request
.
invalidate
()
self
.
tic
()
self
.
assertNotEqual
(
hosting_subscription
.
getPredecessorList
(),
[])
class
TestSlapOSFolder_getOpenTicketList
(
TestCRMSkinsMixin
):
class
TestSlapOSFolder_getOpenTicketList
(
TestCRMSkinsMixin
):
def
_test_ticket
(
self
,
ticket
,
expected_amount
):
def
_test_ticket
(
self
,
ticket
,
expected_amount
):
...
...
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