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
ebf27837
Commit
ebf27837
authored
Oct 31, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test instance.rename
parent
d3a7c021
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreInstanceSlapInterfaceWorkflow.py
...mplateItem/testSlapOSCoreInstanceSlapInterfaceWorkflow.py
+57
-0
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreInstanceSlapInterfaceWorkflow.py
View file @
ebf27837
...
...
@@ -98,3 +98,60 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
self
.
instance
.
allocatePartition
(
computer_partition_url
=
computer_partition_url
)
self
.
assertEqual
(
self
.
instance
.
getAggregate
(),
computer_partition_url
)
def
test_softwareInstanceRename_new_name_required
(
self
):
self
.
login
(
self
.
instance
.
getReference
())
self
.
assertRaises
(
KeyError
,
self
.
instance
.
rename
)
def
test_softwareInstanceRename
(
self
):
new_name
=
'New %s'
%
self
.
generateNewId
()
self
.
login
(
self
.
instance
.
getReference
())
self
.
instance
.
rename
(
new_name
=
new_name
)
self
.
assertEqual
(
new_name
,
self
.
instance
.
getTitle
())
transaction
.
abort
()
def
test_softwareInstanceRename_twice_not_indexed
(
self
):
new_name
=
'New %s'
%
self
.
generateNewId
()
self
.
login
(
self
.
instance
.
getReference
())
self
.
instance
.
rename
(
new_name
=
new_name
)
self
.
assertEqual
(
new_name
,
self
.
instance
.
getTitle
())
transaction
.
commit
()
self
.
assertRaises
(
NotImplementedError
,
self
.
instance
.
rename
,
new_name
=
new_name
)
transaction
.
abort
()
@
expectedFailure
def
test_softwareInstanceRename_twice_same_transaction
(
self
):
new_name
=
'New %s'
%
self
.
generateNewId
()
self
.
login
(
self
.
instance
.
getReference
())
self
.
instance
.
rename
(
new_name
=
new_name
)
self
.
assertEqual
(
new_name
,
self
.
instance
.
getTitle
())
self
.
assertRaises
(
NotImplementedError
,
self
.
instance
.
rename
,
new_name
=
new_name
)
transaction
.
abort
()
def
test_softwareInstanceRename_existing
(
self
):
new_name
=
'New %s'
%
self
.
generateNewId
()
self
.
login
(
self
.
instance
.
getReference
())
request_kw
=
dict
(
software_release
=
\
self
.
generateNewSoftwareReleaseUrl
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
new_name
,
state
=
'started'
)
self
.
instance
.
requestInstance
(
**
request_kw
)
request_instance
=
self
.
instance
.
REQUEST
[
'request_instance'
]
self
.
instance
.
REQUEST
[
'request_instance'
]
=
None
# test sanity check
self
.
assertEqual
(
new_name
,
request_instance
.
getTitle
())
self
.
tic
()
self
.
assertRaises
(
ValueError
,
self
.
instance
.
rename
,
new_name
=
new_name
)
transaction
.
abort
()
master/bt5/slapos_cloud/bt/revision
View file @
ebf27837
170
\ No newline at end of file
171
\ No newline at end of file
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