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
ecc0d024
Commit
ecc0d024
authored
Sep 15, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: stop using old assert methods
parent
c304e5bf
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
103 additions
and
103 deletions
+103
-103
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
...ortal_components/test.erp5.testSlapOSAccountingBuilder.py
+1
-1
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+2
-2
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
...ents/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
+10
-10
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+6
-6
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5InteractionWorkflow.py
...components/test.erp5.testSlapOSERP5InteractionWorkflow.py
+41
-41
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+27
-27
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+3
-3
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+5
-5
master/product/SlapOS/tests/testSlapOSUpgradeInstanceWithOldDataFs.py
...ct/SlapOS/tests/testSlapOSUpgradeInstanceWithOldDataFs.py
+2
-2
slapos/tests/test_cli.py
slapos/tests/test_cli.py
+6
-6
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
View file @
ecc0d024
...
...
@@ -1336,7 +1336,7 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin):
built_update_line
.
getResource
())
self
.
assertEqual
(
1.0
,
built_subscription_line
.
getQuantity
())
self
.
assertAlmostEqual
s
(
0.0
,
built_subscription_line
.
getPrice
(),
3
)
self
.
assertAlmostEqual
(
0.0
,
built_subscription_line
.
getPrice
(),
3
)
self
.
assertEqual
(
subscription_line
.
getResource
(),
built_subscription_line
.
getResource
())
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
ecc0d024
...
...
@@ -661,7 +661,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type
=
"Person"
,
user_id
=
user_id
)
self
.
assertNotEqual
s
(
person
,
None
)
self
.
assertNotEqual
(
person
,
None
)
# User received an email for payment
email
=
person
.
getDefaultEmailText
()
...
...
@@ -694,7 +694,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type
=
"Person"
,
user_id
=
user_id
)
self
.
assertNotEqual
s
(
person
,
None
)
self
.
assertNotEqual
(
person
,
None
)
# User received an email for payment
email
=
person
.
getDefaultEmailText
()
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
View file @
ecc0d024
...
...
@@ -147,8 +147,8 @@ The slapos team
ticket
,
event
=
person
.
Person_checkToCreateRegularisationRequest
()
transaction
.
commit
()
ticket2
,
event2
=
person
.
Person_checkToCreateRegularisationRequest
()
self
.
assertNotEqual
s
(
ticket
,
None
)
self
.
assertNotEqual
s
(
event
,
None
)
self
.
assertNotEqual
(
ticket
,
None
)
self
.
assertNotEqual
(
event
,
None
)
self
.
assertEqual
(
ticket2
,
None
)
self
.
assertEqual
(
event2
,
None
)
...
...
@@ -169,8 +169,8 @@ The slapos team
transaction
.
commit
()
self
.
tic
()
ticket2
,
event2
=
person
.
Person_checkToCreateRegularisationRequest
()
self
.
assertNotEqual
s
(
ticket
,
None
)
self
.
assertNotEqual
s
(
event
,
None
)
self
.
assertNotEqual
(
ticket
,
None
)
self
.
assertNotEqual
(
event
,
None
)
self
.
assertEqual
(
ticket2
.
getRelativeUrl
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event2
,
None
)
...
...
@@ -182,8 +182,8 @@ The slapos team
transaction
.
commit
()
self
.
tic
()
ticket2
,
event2
=
person
.
Person_checkToCreateRegularisationRequest
()
self
.
assertNotEqual
s
(
ticket
,
None
)
self
.
assertNotEqual
s
(
event
,
None
)
self
.
assertNotEqual
(
ticket
,
None
)
self
.
assertNotEqual
(
event
,
None
)
self
.
assertEqual
(
ticket2
.
getRelativeUrl
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event2
,
None
)
...
...
@@ -195,8 +195,8 @@ The slapos team
transaction
.
commit
()
self
.
tic
()
ticket2
,
event2
=
person
.
Person_checkToCreateRegularisationRequest
()
self
.
assertNotEqual
s
(
ticket2
.
getRelativeUrl
(),
ticket
.
getRelativeUrl
())
self
.
assertNotEqual
s
(
event2
,
None
)
self
.
assertNotEqual
(
ticket2
.
getRelativeUrl
(),
ticket
.
getRelativeUrl
())
self
.
assertNotEqual
(
event2
,
None
)
def
test_addRegularisationRequest_REQUEST_disallowed
(
self
):
person
=
self
.
makePerson
(
index
=
0
,
user
=
0
)
...
...
@@ -347,7 +347,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
'service_module/slapos_crm_spam'
,
'foo2 title'
,
'foo2 content'
,
'foo2 comment'
)
self
.
assertEqual
(
ticket
.
getResource
(),
'foo/bar'
)
self
.
assertNotEqual
s
(
event
.
getTitle
(),
'foo2 title'
)
self
.
assertNotEqual
(
event
.
getTitle
(),
'foo2 title'
)
self
.
assertEqual
(
event
.
getTextContent
(),
None
)
self
.
assertEqual
(
event
.
getSimulationState
(),
'draft'
)
self
.
assertEqual
(
event
.
getRelativeUrl
(),
event2
.
getRelativeUrl
())
...
...
@@ -379,7 +379,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
transaction
.
commit
()
event2
=
ticket
.
RegularisationRequest_checkToSendUniqEvent
(
'service_module/slapos_crm_spam'
,
'foo2 title'
,
'foo2 content'
,
'foo2 comment'
)
self
.
assertNotEqual
s
(
event
,
event2
)
self
.
assertNotEqual
(
event
,
event2
)
self
.
assertEqual
(
event2
,
None
)
def
test_checkToSendUniqEvent_REQUEST_disallowed
(
self
):
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
ecc0d024
...
...
@@ -107,7 +107,7 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
module
=
self
.
portal
.
support_request_module
# We assume here that several objects created by others tests don't influentiate
# this test.
self
.
assertEqual
s
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
hosting_subscription
=
self
.
_makeHostingSubscription
()
self
.
_makeSoftwareInstance
(
hosting_subscription
,
"https://xxx/"
)
support_request
=
module
.
newContent
(
portal_type
=
"Support Request"
)
...
...
@@ -669,7 +669,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(TestCRMSkinsMixin):
self
.
tic
()
self
.
assertEqual
(
computer
.
getAllocationScope
(),
'open/personal'
)
#ticket = self._getGeneratedSupportRequest(computer)
self
.
assertNotEqual
s
(
None
,
ticket
)
self
.
assertNotEqual
(
None
,
ticket
)
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'suspended'
)
self
.
assertEqual
(
'Visited by SupportRequest_trySendNotificationMessage '
\
...
...
@@ -1800,7 +1800,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self
.
assertEqual
(
title
,
first_event
.
getTitle
())
self
.
assertEqual
(
text_content
,
first_event
.
getTextContent
())
self
.
assertNotEqual
s
(
None
,
first_event
.
getStartDate
())
self
.
assertNotEqual
(
None
,
first_event
.
getStartDate
())
self
.
assertEqual
(
"service_module/slapos_crm_information"
,
first_event
.
getResource
())
self
.
assertEqual
(
first_event
.
getDestination
(),
person
.
getRelativeUrl
())
...
...
@@ -1814,7 +1814,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self
.
assertEqual
(
title
,
event
.
getTitle
())
self
.
assertEqual
(
text_content
,
event
.
getTextContent
())
self
.
assertNotEqual
s
(
None
,
event
.
getStartDate
())
self
.
assertNotEqual
(
None
,
event
.
getStartDate
())
self
.
assertEqual
(
"service_module/slapos_crm_information"
,
event
.
getResource
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
...
...
@@ -1827,7 +1827,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self
.
assertEqual
(
event
.
getTitle
(),
title
)
self
.
assertEqual
(
text_content
,
event
.
getTextContent
())
self
.
assertNotEqual
s
(
None
,
event
.
getStartDate
())
self
.
assertNotEqual
(
None
,
event
.
getStartDate
())
self
.
assertEqual
(
"service_module/slapos_crm_information"
,
event
.
getResource
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
...
...
@@ -1853,7 +1853,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self
.
assertEqual
(
title
,
another_first_event
.
getTitle
())
self
.
assertEqual
(
text_content
,
another_first_event
.
getTextContent
())
self
.
assertNotEqual
s
(
None
,
another_first_event
.
getStartDate
())
self
.
assertNotEqual
(
None
,
another_first_event
.
getStartDate
())
self
.
assertEqual
(
"service_module/slapos_crm_information"
,
another_first_event
.
getResource
())
self
.
assertEqual
(
another_first_event
.
getDestination
(),
person
.
getRelativeUrl
())
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5InteractionWorkflow.py
View file @
ecc0d024
...
...
@@ -38,9 +38,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
commit
()
self
.
assertEqual
s
(
computer
.
getCapacityScope
(),
'close'
)
self
.
assertEqual
s
(
computer
.
getMonitorScope
(),
'enabled'
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
expected_upgrade_scope
)
self
.
assertEqual
(
computer
.
getCapacityScope
(),
'close'
)
self
.
assertEqual
(
computer
.
getMonitorScope
(),
'enabled'
)
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
expected_upgrade_scope
)
return
computer
def
test_Computer_setAllocationScope_public_no_source_adm
(
self
):
...
...
@@ -79,8 +79,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
=
self
.
_test_Computer_setAllocationScope_public
(
source_administration
=
person
.
getRelativeUrl
())
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
''
])
self
.
assertEqual
s
(
computer
.
getDestinationSection
(),
None
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
''
])
self
.
assertEqual
(
computer
.
getDestinationSection
(),
None
)
def
test_Computer_setAllocationScope_subscription_with_source_adm
(
self
):
person
=
self
.
makePerson
()
...
...
@@ -90,8 +90,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
source_administration
=
person
.
getRelativeUrl
(),
allocation_scope
=
"open/subscription"
)
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
''
])
self
.
assertEqual
s
(
computer
.
getDestinationSection
(),
None
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
''
])
self
.
assertEqual
(
computer
.
getDestinationSection
(),
None
)
def
_test_Computer_setAllocationScope_personal
(
self
,
...
...
@@ -109,29 +109,29 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
.
edit
(
allocation_scope
=
'open/personal'
)
self
.
commit
()
self
.
assertEqual
s
(
computer
.
getCapacityScope
(),
'open'
)
self
.
assertEqual
s
(
computer
.
getMonitorScope
(),
'disabled'
)
self
.
assertEqual
(
computer
.
getCapacityScope
(),
'open'
)
self
.
assertEqual
(
computer
.
getMonitorScope
(),
'disabled'
)
return
computer
def
test_Computer_setAllocationScope_personal
(
self
):
computer
=
self
.
_test_Computer_setAllocationScope_personal
()
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
'ask_confirmation'
)
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[])
self
.
assertEqual
s
(
computer
.
getDestinationSection
(),
None
)
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
'ask_confirmation'
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[])
self
.
assertEqual
(
computer
.
getDestinationSection
(),
None
)
def
test_Computer_setAllocationScope_personal_upgrade_disabled
(
self
):
computer
=
self
.
_test_Computer_setAllocationScope_personal
(
upgrade_scope
=
"disabled"
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
'disabled'
)
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[])
self
.
assertEqual
s
(
computer
.
getDestinationSection
(),
None
)
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
'disabled'
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[])
self
.
assertEqual
(
computer
.
getDestinationSection
(),
None
)
def
test_Computer_setAllocationScope_personal_upgrade_auto
(
self
):
computer
=
self
.
_test_Computer_setAllocationScope_personal
(
upgrade_scope
=
"auto"
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
'auto'
)
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[])
self
.
assertEqual
s
(
computer
.
getDestinationSection
(),
None
)
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
'auto'
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[])
self
.
assertEqual
(
computer
.
getDestinationSection
(),
None
)
def
test_Computer_setAllocationScope_personal_with_source_adm
(
self
):
person
=
self
.
makePerson
()
...
...
@@ -141,9 +141,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
=
self
.
_test_Computer_setAllocationScope_personal
(
source_administration
=
person
.
getRelativeUrl
(),
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
'ask_confirmation'
)
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
'ask_confirmation'
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
def
test_Computer_setAllocationScope_personal_with_subject_list
(
self
):
...
...
@@ -155,9 +155,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
source_administration
=
person
.
getRelativeUrl
(),
subject_list
=
[
"some@example.com"
]
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
'ask_confirmation'
)
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
'ask_confirmation'
)
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
def
_test_Computer_setAllocationScope_friend
(
self
,
...
...
@@ -179,9 +179,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
.
edit
(
allocation_scope
=
'open/friend'
)
self
.
commit
()
self
.
assertEqual
s
(
computer
.
getCapacityScope
(),
'open'
)
self
.
assertEqual
s
(
computer
.
getMonitorScope
(),
'enabled'
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
expected_upgrade_scope
)
self
.
assertEqual
(
computer
.
getCapacityScope
(),
'open'
)
self
.
assertEqual
(
computer
.
getMonitorScope
(),
'enabled'
)
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
expected_upgrade_scope
)
return
computer
def
test_Computer_setAllocationScope_friend_no_source_adm
(
self
):
...
...
@@ -204,8 +204,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
=
self
.
_test_Computer_setAllocationScope_friend
(
source_administration
=
person
.
getRelativeUrl
())
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
def
test_Computer_setAllocationScope_friend_with_subject_list
(
self
):
...
...
@@ -221,7 +221,7 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
self
.
assertSameSet
(
computer
.
getSubjectList
(),
[
'some@example.com'
,
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
...
...
@@ -241,9 +241,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
commit
()
self
.
assertEqual
s
(
computer
.
getCapacityScope
(),
'close'
)
self
.
assertEqual
s
(
computer
.
getMonitorScope
(),
'disabled'
)
self
.
assertEqual
s
(
computer
.
getUpgradeScope
(),
upgrade_scope
)
self
.
assertEqual
(
computer
.
getCapacityScope
(),
'close'
)
self
.
assertEqual
(
computer
.
getMonitorScope
(),
'disabled'
)
self
.
assertEqual
(
computer
.
getUpgradeScope
(),
upgrade_scope
)
return
computer
...
...
@@ -258,8 +258,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer
=
self
.
_test_Computer_setAllocationScope_closed
(
source_administration
=
person
.
getRelativeUrl
())
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
def
test_Computer_setAllocationScope_closed_termination_no_source_adm
(
self
):
...
...
@@ -276,8 +276,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope
=
"close/termination"
,
source_administration
=
person
.
getRelativeUrl
())
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
def
test_Computer_setAllocationScope_closed_outdated_no_source_adm
(
self
):
...
...
@@ -294,8 +294,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope
=
"close/outdated"
,
source_administration
=
person
.
getRelativeUrl
())
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
def
test_Computer_setAllocationScope_closed_maintenance_no_source_adm
(
self
):
...
...
@@ -312,8 +312,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope
=
"close/maintenance"
,
source_administration
=
person
.
getRelativeUrl
())
self
.
assertEqual
s
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
s
(
computer
.
getDestinationSectionList
(),
self
.
assertEqual
(
computer
.
getSubjectList
(),
[
person
.
getDefaultEmailCoordinateText
()])
self
.
assertEqual
(
computer
.
getDestinationSectionList
(),
[
person
.
getRelativeUrl
()])
...
...
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
ecc0d024
...
...
@@ -141,7 +141,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription
=
self
.
_makeHostingSubscription
()
news_dict
=
hosting_subscription
.
HostingSubscription_getNewsDict
()
expected_news_dict
=
{
'instance'
:
[]}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -150,7 +150,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription
.
setRootSlave
(
1
)
news_dict
=
hosting_subscription
.
HostingSubscription_getNewsDict
()
expected_news_dict
=
{
'instance'
:
[],
'is_slave'
:
1
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -159,7 +159,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription
.
getSlapState
=
fakeStopRequestedSlapState
news_dict
=
hosting_subscription
.
HostingSubscription_getNewsDict
()
expected_news_dict
=
{
'instance'
:
[],
'is_stopped'
:
1
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -168,7 +168,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription
.
getSlapState
=
fakeDestroyRequestedSlapState
news_dict
=
hosting_subscription
.
HostingSubscription_getNewsDict
()
expected_news_dict
=
{
'instance'
:
[],
'is_destroyed'
:
1
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -182,7 +182,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict
=
{
'instance'
:
[{
'no_data'
:
1
,
'text'
:
'#error no data found for %s'
%
instance
.
getReference
(),
'user'
:
'SlapOS Master'
}]}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -194,7 +194,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
self
.
changeSkin
(
'Hal'
)
news_dict
=
hosting_subscription
.
HostingSubscription_getNewsDict
()
expected_news_dict
=
{
'instance'
:
[]}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -214,7 +214,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
{
'no_data'
:
1
,
'text'
:
'#error no data found for %s'
%
instance
.
getReference
(),
'user'
:
'SlapOS Master'
}]}
self
.
assertEqual
s
(
news_dict
[
"instance"
],
expected_news_dict
[
"instance"
])
self
.
assertEqual
(
news_dict
[
"instance"
],
expected_news_dict
[
"instance"
])
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -231,7 +231,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state'
:
'start_requested'
,
'text'
:
u'#access OK'
,
u'user'
:
u'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -242,7 +242,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict
=
{
'no_data'
:
1
,
'text'
:
'#error no data found for %s'
%
instance
.
getReference
(),
'user'
:
'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -252,7 +252,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict
=
{
'is_slave'
:
1
,
'text'
:
'#nodata is a slave %s'
%
instance
.
getReference
(),
'user'
:
'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -265,7 +265,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
"text"
:
"#nodata is an stopped instance %s"
%
instance
.
getReference
(),
"is_stopped"
:
1
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -278,7 +278,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
"text"
:
"#nodata is an destroyed instance %s"
%
instance
.
getReference
(),
"is_destroyed"
:
1
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -295,7 +295,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state'
:
'start_requested'
,
'text'
:
u'#access OK'
,
u'user'
:
u'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -313,7 +313,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state'
:
'stop_requested'
,
'text'
:
u'#access OK'
,
u'user'
:
u'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -331,7 +331,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state'
:
'destroy_requested'
,
'text'
:
u'#access OK'
,
u'user'
:
u'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -341,7 +341,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict
=
{
'no_data'
:
1
,
'text'
:
'#error no data found for %s'
%
installation
.
getReference
(),
'user'
:
'SlapOS Master'
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -361,7 +361,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
u'user'
:
u'SlapOS Master'
},
'partition'
:
{}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -382,7 +382,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'user'
:
'SlapOS Master'
},
'partition'
:
{}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -403,7 +403,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'user'
:
u'SlapOS Master'
},
'partition'
:
{}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -416,7 +416,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'user'
:
'SlapOS Master'
},
'partition'
:
{}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -440,7 +440,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'text'
:
'#error no data found for %s'
%
(
instance
.
getReference
()),
'user'
:
'SlapOS Master'
}}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -475,7 +475,7 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -484,7 +484,7 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
self
.
_logFakeAccess
(
network
.
getReference
())
news_dict
=
network
.
ComputerNetwork_getNewsDict
()
expected_news_dict
=
{
'computer'
:
{},
'partition'
:
{}}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -521,7 +521,7 @@ class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin):
}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -529,7 +529,7 @@ class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin):
organisation
=
self
.
_makeOrganisation
()
news_dict
=
organisation
.
Organisation_getNewsDict
()
expected_news_dict
=
{
'computer'
:
{},
'partition'
:
{}}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -566,7 +566,7 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
}
}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
@@ -574,7 +574,7 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
project
=
self
.
_makeProject
()
news_dict
=
project
.
Project_getNewsDict
()
expected_news_dict
=
{
'computer'
:
{},
'partition'
:
{}}
self
.
assertEqual
s
(
news_dict
,
expected_news_dict
)
self
.
assertEqual
(
news_dict
,
expected_news_dict
)
# Ensure it don't raise error when converting to JSON
json
.
dumps
(
news_dict
)
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
ecc0d024
...
...
@@ -1657,9 +1657,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
xml_fp
.
seek
(
0
)
got_xml
=
xml_fp
.
read
()
self
.
assertNotEqual
s
(
created_at
,
ncreated_at
)
self
.
assertNotEqual
s
(
since
,
ncreated_at
)
self
.
assertEqual
s
(
since
,
created_at
)
self
.
assertNotEqual
(
created_at
,
ncreated_at
)
self
.
assertNotEqual
(
since
,
ncreated_at
)
self
.
assertEqual
(
since
,
created_at
)
expected_xml
=
"""
\
<?xml version='1.0' encoding='UTF-8'?>
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
View file @
ecc0d024
...
...
@@ -1123,7 +1123,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self
.
assertEqual
(
expected_test_payment_balance
,
subscription_request
.
SubscriptionRequest_testPaymentBalance
())
self
.
assertEqual
s
(
'start_requested'
,
self
.
assertEqual
(
'start_requested'
,
subscription_request
.
getAggregateValue
().
getSlapState
())
# The alarms might be called multiple times for move each step
...
...
@@ -1134,7 +1134,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self
.
assertEqual
(
expected_test_payment_balance
,
subscription_request
.
SubscriptionRequest_testPaymentBalance
())
self
.
assertEqual
s
(
expected_slap_state_after_subscription_is_confirmed
,
self
.
assertEqual
(
expected_slap_state_after_subscription_is_confirmed
,
subscription_request
.
getAggregateValue
().
getSlapState
())
def
checkSubscriptionDeploymentAndSimulationWithReversalTransaction
(
self
,
default_email_text
,
subscription_server
):
...
...
@@ -1168,7 +1168,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self
.
assertTrue
(
subscription_request
.
SubscriptionRequest_testPaymentBalance
())
self
.
assertEqual
s
(
'start_requested'
,
self
.
assertEqual
(
'start_requested'
,
subscription_request
.
getAggregateValue
().
getSlapState
())
self
.
checkStartedSubscriptionRequest
(
subscription_request
,
...
...
@@ -1204,7 +1204,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self
.
assertTrue
(
subscription_request
.
SubscriptionRequest_testPaymentBalance
())
self
.
assertEqual
s
(
'start_requested'
,
self
.
assertEqual
(
'start_requested'
,
subscription_request
.
getAggregateValue
().
getSlapState
())
self
.
checkStartedSubscriptionRequest
(
subscription_request
,
...
...
@@ -1219,7 +1219,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
default_email_text
,
self
.
subscription_condition
)
for
subscription_request
in
subscription_request_list
:
self
.
assertEqual
s
(
'start_requested'
,
self
.
assertEqual
(
'start_requested'
,
subscription_request
.
getAggregateValue
().
getSlapState
())
# Destroy all instances and process
...
...
master/product/SlapOS/tests/testSlapOSUpgradeInstanceWithOldDataFs.py
View file @
ecc0d024
...
...
@@ -48,7 +48,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin):
alarm
=
self
.
portal
.
portal_alarms
.
promise_check_upgrade
alarm
.
solve
()
self
.
tic
()
self
.
assertEqual
s
(
alarm
.
getLastActiveProcess
().
getResultList
(),
[])
self
.
assertEqual
(
alarm
.
getLastActiveProcess
().
getResultList
(),
[])
bt5_list
=
self
.
portal
.
portal_templates
.
getInstalledBusinessTemplateTitleList
()
self
.
assertTrue
(
'slapos_erp5'
in
bt5_list
,
bt5_list
)
...
...
@@ -63,7 +63,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin):
portal_type_class
.
loadClass
()
if
issubclass
(
portal_type_class
,
ERP5BaseBroken
):
error_list
.
append
(
portal_type_id
)
self
.
assertEqual
s
(
self
.
assertEqual
(
error_list
,
[],
msg
=
"The following Portal Type classes could not be loaded (see zLOG.log): %r"
%
error_list
)
...
...
slapos/tests/test_cli.py
View file @
ecc0d024
...
...
@@ -73,7 +73,7 @@ class TestCliCache(CliMixin):
test_url
=
"https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg"
def
test_cached_binary
(
self
):
self
.
assertEqual
s
(
0
,
cache_do_lookup
(
self
.
assertEqual
(
0
,
cache_do_lookup
(
self
.
logger
,
cache_dir
=
"http://dir.shacache.org"
,
software_url
=
self
.
test_url
))
...
...
@@ -90,7 +90,7 @@ class TestCliCache(CliMixin):
self
.
logger
.
info
.
assert_any_call
(
u'------------------------------------------'
)
def
test_uncached_binary
(
self
):
self
.
assertEqual
s
(
10
,
cache_do_lookup
(
self
.
assertEqual
(
10
,
cache_do_lookup
(
self
.
logger
,
cache_dir
=
"http://dir.shacache.org"
,
software_url
=
"this_is_uncached_url"
))
...
...
@@ -98,7 +98,7 @@ class TestCliCache(CliMixin):
self
.
logger
.
critical
.
assert_any_call
(
'Object not in cache: %s'
,
'this_is_uncached_url'
)
def
test_bad_cache_dir
(
self
):
self
.
assertEqual
s
(
10
,
cache_do_lookup
(
self
.
assertEqual
(
10
,
cache_do_lookup
(
self
.
logger
,
cache_dir
=
"http://xxx.shacache.org"
,
software_url
=
self
.
test_url
))
...
...
@@ -112,7 +112,7 @@ class TestCliCacheSource(CliMixin):
test_url
=
"https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.17.1.tar.xz"
def
test_cached_source
(
self
):
self
.
assertEqual
s
(
0
,
cache_source_do_lookup
(
self
.
assertEqual
(
0
,
cache_source_do_lookup
(
self
.
logger
,
cache_dir
=
"http://dir.shacache.org"
,
url
=
self
.
test_url
))
...
...
@@ -147,7 +147,7 @@ class TestCliCacheSource(CliMixin):
'------------'
)
def
test_uncached_binary
(
self
):
self
.
assertEqual
s
(
10
,
cache_source_do_lookup
(
self
.
assertEqual
(
10
,
cache_source_do_lookup
(
self
.
logger
,
cache_dir
=
"http://dir.shacache.org"
,
url
=
"this_is_uncached_url"
))
...
...
@@ -155,7 +155,7 @@ class TestCliCacheSource(CliMixin):
self
.
logger
.
critical
.
assert_any_call
(
'Object not in cache: %s'
,
'this_is_uncached_url'
)
def
test_bad_cache_dir
(
self
):
self
.
assertEqual
s
(
10
,
cache_source_do_lookup
(
self
.
assertEqual
(
10
,
cache_source_do_lookup
(
self
.
logger
,
cache_dir
=
"http://xxx.shacache.org"
,
url
=
self
.
test_url
))
...
...
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