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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
1c4b587e
Commit
1c4b587e
authored
Jan 31, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: lint
parent
696d11b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
9 deletions
+61
-9
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+61
-9
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
1c4b587e
...
@@ -477,7 +477,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
...
@@ -477,7 +477,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
class
TestSlapOSCrmMonitoringCheckComputeNodeState
(
SlapOSTestCaseMixinWithAbort
):
class
TestSlapOSCrmMonitoringCheckComputeNodeState
(
SlapOSTestCaseMixinWithAbort
):
def
test_alarm_check_public_compute_node_state
(
self
):
def
test_alarm_check_public_compute_node_state
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
tic
()
self
.
tic
()
self
.
assertEqual
(
self
.
compute_node
.
getMonitorScope
(),
"enabled"
)
self
.
assertEqual
(
self
.
compute_node
.
getMonitorScope
(),
"enabled"
)
...
@@ -487,7 +487,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
...
@@ -487,7 +487,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkState"
)
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkState"
)
def
test_alarm_check_personal_compute_node_state
(
self
):
def
test_alarm_check_personal_compute_node_state
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
tic
()
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
alarm
=
self
.
portal
.
portal_alarms
.
\
...
@@ -509,7 +509,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
...
@@ -509,7 +509,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
def
_test_alarm_check_compute_node_state_not_selected
(
self
,
allocation_scope
,
def
_test_alarm_check_compute_node_state_not_selected
(
self
,
allocation_scope
,
monitor_scope
=
None
):
monitor_scope
=
None
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
tic
()
self
.
tic
()
if
monitor_scope
is
not
None
:
if
monitor_scope
is
not
None
:
...
@@ -546,18 +546,57 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
...
@@ -546,18 +546,57 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self
.
_test_alarm_check_compute_node_state_selected
(
self
.
_test_alarm_check_compute_node_state_selected
(
allocation_scope
=
'close/noallocation'
)
allocation_scope
=
'close/noallocation'
)
class
TestSlapOSCrmMonitoringCheckComputeNodeAllocationScope
(
SlapOSTestCaseMixinWithAbort
):
def
test_alarm_not_allowed_allocation_scope_OpenPublic
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_update_allocation_scope
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkAndUpdateAllocationScope"
)
def
test_alarm_not_allowed_allocation_scope_OpenFriend
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open/friend'
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_update_allocation_scope
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkAndUpdateAllocationScope"
)
def
test_alarm_not_allowed_allocationScope_open_personal
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_update_allocation_scope
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkAndUpdateAllocationScope"
)
class
TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation
(
SlapOSTestCaseMixinWithAbort
):
class
TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation
(
SlapOSTestCaseMixinWithAbort
):
def
test_alarm_run_on_open_public
(
self
):
def
test_alarm_run_on_open_public
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
tic
()
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_software_installation_state
slapos_crm_check_software_installation_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
<<<<<<<
HEAD
=======
def
test_alarm_run_on_open_friend
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open/friend'
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_software_installation_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
>>>>>>>
slapos_crm
:
lint
def
test_alarm_run_on_open_personal
(
self
):
def
test_alarm_run_on_open_personal
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
,
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
,
monitor_scope
=
"enabled"
)
monitor_scope
=
"enabled"
)
self
.
tic
()
self
.
tic
()
...
@@ -566,7 +605,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
...
@@ -566,7 +605,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
def
test_alarm_dont_run_on_open_public_with_monitor_scope_disabled
(
self
):
def
test_alarm_dont_run_on_open_public_with_monitor_scope_disabled
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/public'
)
self
.
tic
()
self
.
tic
()
self
.
compute_node
.
edit
(
monitor_scope
=
'disabled'
)
self
.
compute_node
.
edit
(
monitor_scope
=
'disabled'
)
...
@@ -575,8 +614,21 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
...
@@ -575,8 +614,21 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
slapos_crm_check_software_installation_state
slapos_crm_check_software_installation_state
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
<<<<<<<
HEAD
=======
def
test_alarm_dont_run_on_open_friend_with_monitor_scope_disabled
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open/friend'
)
self
.
tic
()
self
.
compute_node
.
edit
(
monitor_scope
=
'disabled'
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_software_installation_state
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
>>>>>>>
slapos_crm
:
lint
def
test_alarm_dont_run_on_open_personal_with_monitor_scope_disabled
(
self
):
def
test_alarm_dont_run_on_open_personal_with_monitor_scope_disabled
(
self
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
,
self
.
compute_node
.
edit
(
allocation_scope
=
'open/personal'
,
monitor_scope
=
"enabled"
)
monitor_scope
=
"enabled"
)
self
.
tic
()
self
.
tic
()
...
@@ -587,7 +639,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
...
@@ -587,7 +639,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
def
_test_alarm_not_run_on_close
(
self
,
allocation_scope
,
monitor_scope
=
None
):
def
_test_alarm_not_run_on_close
(
self
,
allocation_scope
,
monitor_scope
=
None
):
self
.
_makeComputeNode
()
self
.
_makeComputeNode
(
self
.
addProject
()
)
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
tic
()
self
.
tic
()
if
monitor_scope
is
not
None
:
if
monitor_scope
is
not
None
:
...
@@ -746,7 +798,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
...
@@ -746,7 +798,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
class
TestSlaposCrmSendPendingTicket_reminder
(
SlapOSTestCaseMixinWithAbort
):
class
TestSlaposCrmSendPendingTicket_reminder
(
SlapOSTestCaseMixinWithAbort
):
def
test_alarm_send_pending_ticket_reminder
(
self
):
def
test_alarm_send_pending_ticket_reminder
(
self
):
person
=
self
.
makePerson
()
person
=
self
.
makePerson
(
self
.
addProject
()
)
alarm
=
self
.
portal
.
portal_alarms
.
\
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_send_pending_ticket_reminder
slapos_crm_send_pending_ticket_reminder
self
.
_test_alarm
(
alarm
,
person
,
"Person_sendPendingTicketReminder"
)
self
.
_test_alarm
(
alarm
,
person
,
"Person_sendPendingTicketReminder"
)
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