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
Titouan Soulard
slapos.core
Commits
d33defd4
Commit
d33defd4
authored
Apr 06, 2023
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Nov 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Move tests to jIO API add legacy Tests class for SlapTool
parent
4f2594ba
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1972 additions
and
0 deletions
+1972
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionCDNScenario.py
...components/test.erp5.testSlapOSSubscriptionCDNScenario.py
+126
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+1846
-0
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionCDNScenario.py
0 → 100644
View file @
d33defd4
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
erp5.component.test.testSlapOSSubscriptionScenario
import
TestSlapOSSubscriptionScenarioMixin
from
erp5.component.test.SlapOSTestCaseDefaultScenarioMixin
import
DefaultScenarioMixinSlapTool
class
TestSlapOSSubscriptionCDNScenarioMixin
(
TestSlapOSSubscriptionScenarioMixin
):
def
afterSetUp
(
self
):
TestSlapOSSubscriptionScenarioMixin
.
afterSetUp
(
self
)
self
.
expected_individual_price_without_tax
=
5
self
.
expected_individual_price_with_tax
=
6.0
self
.
expected_reservation_fee
=
1.2
self
.
expected_reservation_fee_without_tax
=
1
self
.
expected_reservation_quantity_tax
=
1.0
self
.
expected_reservation_tax
=
0.2
self
.
expected_price_currency
=
"currency_module/EUR"
self
.
expected_zh_individual_price_without_tax
=
40
self
.
expected_zh_individual_price_with_tax
=
40
self
.
expected_zh_reservation_fee
=
8.0
self
.
expected_zh_reservation_fee_without_tax
=
8.0
self
.
expected_zh_reservation_quantity_tax
=
8.0
self
.
expected_zh_reservation_tax
=
0
self
.
resource_variation_reference
=
"CDN"
self
.
login
()
# Overwrite default Subscription Condition.
self
.
createSubscriptionCondition
(
slave
=
True
)
# some preparation
self
.
logout
()
def
createPublicServerForAdminUser
(
self
):
subscription_server
=
TestSlapOSSubscriptionScenarioMixin
.
createPublicServerForAdminUser
(
self
)
self
.
login
()
contract
=
self
.
admin_user
.
Person_generateCloudContract
(
batch
=
True
)
if
contract
.
getValidationState
()
in
[
"draft"
,
"invalidated"
]:
contract
.
validate
()
self
.
tic
()
# now instantiate it on compute_node and set some nice connection dict
self
.
setServerOpenPersonal
(
subscription_server
)
self
.
login
(
self
.
admin_user
.
getUserId
())
self
.
personRequestInstanceNotReady
(
software_release_uri
=
self
.
subscription_condition
.
getUrlString
(),
software_type
=
self
.
subscription_condition
.
getSourceReference
(),
title
=
"InstanceForSlave%s"
%
self
.
new_id
)
self
.
stepCallSlaposAllocateInstanceAlarm
()
self
.
tic
()
self
.
personRequestInstance
(
software_release_uri
=
self
.
subscription_condition
.
getUrlString
(),
software_type
=
self
.
subscription_condition
.
getSourceReference
(),
title
=
"InstanceForSlave%s"
%
self
.
new_id
)
# now instantiate it on compute_node and set some nice connection dict
self
.
simulateSlapgridCP
(
subscription_server
)
self
.
tic
()
self
.
login
()
self
.
setServerOpenSubscription
(
subscription_server
)
self
.
setAccessToMemcached
(
subscription_server
)
self
.
tic
()
self
.
simulateSlapgridCP
(
subscription_server
)
self
.
logout
()
return
subscription_server
class
TestSlapOSSubscriptionCDNScenario
(
TestSlapOSSubscriptionCDNScenarioMixin
):
def
test_subscription_scenario_with_single_vm
(
self
):
self
.
_test_subscription_scenario
(
amount
=
1
)
def
test_subscription_with_3_vms_scenario
(
self
):
self
.
_test_subscription_scenario
(
amount
=
3
)
def
test_subscription_scenario_with_reversal_transaction
(
self
):
self
.
_test_subscription_scenario_with_reversal_transaction
(
amount
=
1
)
def
test_two_subscription_scenario
(
self
):
self
.
_test_two_subscription_scenario
(
amount
=
1
)
def
test_subscription_scenario_with_existing_user
(
self
):
self
.
_test_subscription_scenario_with_existing_user
(
amount
=
1
,
language
=
"zh"
)
def
test_subscription_scenario_with_existing_user_with_non_subscription_request
(
self
):
self
.
_test_subscription_scenario_with_existing_user_with_non_subscription_request
(
amount
=
1
,
language
=
"en"
)
def
test_subscription_scenario_with_existing_chinese_user
(
self
):
# Messages are in chinese, when subscribed via chinese website. Even if the english language is
# english
self
.
_test_subscription_scenario_with_existing_user
(
amount
=
1
,
language
=
"zh"
)
class
TestSlapOSSubscriptionCDNScenarioSlapTool
(
TestSlapOSSubscriptionCDNScenario
,
DefaultScenarioMixinSlapTool
):
pass
\ No newline at end of file
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
0 → 100644
View file @
d33defd4
This diff is collapsed.
Click to expand it.
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