Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.rebootstrap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.rebootstrap
Commits
a188caa4
Commit
a188caa4
authored
Feb 03, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: use print function for python3 compatibility
and add the <BLANKLINES> where needed.
parent
2420e816
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
10 deletions
+20
-10
slapos/rebootstrap/different_version.txt
slapos/rebootstrap/different_version.txt
+4
-2
slapos/rebootstrap/same_version.txt
slapos/rebootstrap/same_version.txt
+8
-4
slapos/rebootstrap/same_version_already_installed.txt
slapos/rebootstrap/same_version_already_installed.txt
+4
-2
slapos/rebootstrap/tests.py
slapos/rebootstrap/tests.py
+4
-2
No files found.
slapos/rebootstrap/different_version.txt
View file @
a188caa4
...
...
@@ -38,8 +38,9 @@ TODO: The test is incomplete for 2 reasons:
... def __getattr__(self, attr):
... return getattr(sys, attr)
... """)
>>> print
system(buildout),
>>> print
(system(buildout))
Develop: '/sample-buildout/recipes'
<BLANKLINE>
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
...
...
@@ -57,7 +58,7 @@ Develop: '/sample-buildout/recipes'
... recipe = recipes:pyshow
... """ % dict(syspython=sys.executable))
>>> print
system(buildout),
# doctest: +ELLIPSIS
>>> print
(system(buildout))
# doctest: +ELLIPSIS
slapos.rebootstrap: Make sure that the section 'installpython' won't be reinstalled after rebootstrap.
Develop: '/sample-buildout/recipes'
Installing installpython.
...
...
@@ -73,3 +74,4 @@ Buildout will be restarted automatically to have this change applied.
While:
Installing.
Error: Couldn't find a distribution for 'setuptools==...'
<BLANKLINE>
slapos/rebootstrap/same_version.txt
View file @
a188caa4
...
...
@@ -2,8 +2,9 @@ Simple case: switch to a Python with same major/minor version
-------------------------------------------------------------
>>> import sys
>>> print
system(buildout),
>>> print
(system(buildout))
Develop: '/sample-buildout/recipes'
<BLANKLINE>
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
...
...
@@ -21,7 +22,7 @@ Develop: '/sample-buildout/recipes'
... recipe = recipes:pyshow
... """ % dict(syspython=sys.executable))
>>> print
system(buildout),
>>> print
(system(buildout))
slapos.rebootstrap: Make sure that the section 'installpython' won't be reinstalled after rebootstrap.
Develop: '/sample-buildout/recipes'
Installing installpython.
...
...
@@ -39,15 +40,17 @@ Develop: '/sample-buildout/recipes'
Updating installpython.
Installing realrun.
Running with: /sample_buildout/parts/installpython/bin/python
<BLANKLINE>
>>> print
system(buildout),
>>> print
(system(buildout))
Develop: '/sample-buildout/recipes'
Updating installpython.
Updating realrun.
Running with: /sample_buildout/parts/installpython/bin/python
<BLANKLINE>
>>> cp(buildout + '-orig', buildout)
>>> print
system(buildout),
>>> print
(system(buildout))
slapos.rebootstrap: Make sure that the section 'installpython' won't be reinstalled after rebootstrap.
Develop: '/sample-buildout/recipes'
Updating installpython.
...
...
@@ -64,3 +67,4 @@ Develop: '/sample-buildout/recipes'
Updating installpython.
Updating realrun.
Running with: /sample_buildout/parts/installpython/bin/python
<BLANKLINE>
slapos/rebootstrap/same_version_already_installed.txt
View file @
a188caa4
...
...
@@ -3,8 +3,9 @@
An edge case is when the python is provided by a part that does not need to install anything.
>>> import sys
>>> print
system(buildout),
>>> print
(system(buildout))
Develop: '/sample-buildout/recipes'
<BLANKLINE>
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
...
...
@@ -22,9 +23,10 @@ Develop: '/sample-buildout/recipes'
... recipe = recipes:pyshow
... """ % dict(syspython=sys.executable))
>>> print
system(buildout),
>>> print
(system(buildout))
Using already installed /system_python
Develop: '/sample-buildout/recipes'
Installing already_installed_python.
Installing realrun.
Running with: /system_python
<BLANKLINE>
slapos/rebootstrap/tests.py
View file @
a188caa4
...
...
@@ -59,12 +59,13 @@ class Pyinstall:
update = install
"""
)
write
(
sample_buildout
,
'recipes'
,
'pyalreadyinstalled.py'
,
"""
from __future__ import print_function
import os, zc.buildout, shutil, sys
class PyAlreadyInstalled:
def __init__(self, buildout, name, options):
print
"Using already installed", sys.executable
print
("Using already installed", sys.executable)
options['executable'] = sys.executable
def install(self):
...
...
@@ -73,6 +74,7 @@ class PyAlreadyInstalled:
update = install
"""
)
write
(
sample_buildout
,
'recipes'
,
'pyshow.py'
,
"""
from __future__ import print_function
import os, zc.buildout, shutil, sys
class Pyshow:
...
...
@@ -81,7 +83,7 @@ class Pyshow:
pass
def install(self):
print
'Running with:', sys.executable
print
('Running with:', sys.executable)
return []
update = install
...
...
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