Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.cmmi
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
Boxiang Sun
slapos.recipe.cmmi
Commits
f32735bc
Commit
f32735bc
authored
Feb 19, 2010
by
Nicolas Dumazet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test behavior on restart when __compile__ dir is deleted by user
parent
f4a5588d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
hexagonit/recipe/cmmi/tests.py
hexagonit/recipe/cmmi/tests.py
+37
-0
No files found.
hexagonit/recipe/cmmi/tests.py
View file @
f32735bc
...
@@ -5,6 +5,7 @@ import errno
...
@@ -5,6 +5,7 @@ import errno
import
os
import
os
import
re
import
re
import
shutil
import
shutil
import
tarfile
import
tempfile
import
tempfile
import
unittest
import
unittest
import
zc.buildout
import
zc.buildout
...
@@ -103,6 +104,42 @@ class NonInformativeTests(unittest.TestCase):
...
@@ -103,6 +104,42 @@ class NonInformativeTests(unittest.TestCase):
# already exists
# already exists
self
.
assertRaises
(
IOError
,
recipe
.
install
)
self
.
assertRaises
(
IOError
,
recipe
.
install
)
def
test_restart_after_failure
(
self
):
temp_directory
=
tempfile
.
mkdtemp
(
dir
=
self
.
dir
,
prefix
=
"fake_package"
)
configure_path
=
os
.
path
.
join
(
temp_directory
,
'configure'
)
self
.
write_file
(
configure_path
,
'exit 0'
)
makefile_path
=
os
.
path
.
join
(
temp_directory
,
'Makefile'
)
self
.
write_file
(
makefile_path
,
'exit -1'
)
os
.
chdir
(
temp_directory
)
ignore
,
tarfile_path
=
tempfile
.
mkstemp
(
suffix
=
".tar"
)
tar
=
tarfile
.
open
(
tarfile_path
,
'w'
)
tar
.
add
(
'configure'
)
tar
.
add
(
'Makefile'
)
tar
.
close
()
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
tarfile_path
})
os
.
chdir
(
self
.
dir
)
try
:
# expected failure
self
.
assertRaises
(
zc
.
buildout
.
UserError
,
recipe
.
install
)
# User deletes the __compile__ path
build_directory
=
os
.
path
.
join
(
self
.
dir
,
'test_parts/test__compile__'
)
shutil
.
rmtree
(
build_directory
)
# the install should still fail, and _not_ raise an OSError
self
.
assertRaises
(
zc
.
buildout
.
UserError
,
recipe
.
install
)
finally
:
try
:
shutil
.
rmtree
(
temp_directory
)
os
.
remove
(
tarfile_path
)
except
:
pass
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
((
suite
=
unittest
.
TestSuite
((
doctest
.
DocFileSuite
(
doctest
.
DocFileSuite
(
...
...
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