Commit cf95df81 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

style: import UserError and use Recipe().install()

- import UserError from zc.buildout for shorter usage
- use Recipe(...).install() one-liner when recipe varible is uncessary
parent cb8165cb
Pipeline #17631 passed with stage
in 0 seconds
...@@ -8,10 +8,10 @@ import os ...@@ -8,10 +8,10 @@ import os
import re import re
import stat import stat
import subprocess import subprocess
import zc.buildout
import six.moves.urllib as urllib import six.moves.urllib as urllib
from zc.buildout import UserError
from zc.buildout.easy_install import allow_picked_versions from zc.buildout.easy_install import allow_picked_versions
from slapos.recipe import rmtree from slapos.recipe import rmtree
from slapos.recipe.downloadunpacked import Recipe as Download from slapos.recipe.downloadunpacked import Recipe as Download
...@@ -42,13 +42,12 @@ class Recipe(object): ...@@ -42,13 +42,12 @@ class Recipe(object):
if self.gems: if self.gems:
self.gems = self.gems.split() self.gems = self.gems.split()
else: else:
raise zc.buildout.UserError( raise UserError("Configuration error, 'gems' option is missing")
"Configuration error, 'gems' option is missing")
self.url = options.get('url') self.url = options.get('url')
if(self.url and options.get('version')): if(self.url and options.get('version')):
raise zc.buildout.UserError( raise UserError("Configuration error, "
"Configuration error, 'url' and 'version' options are mutually exclusive") "'url' and 'version' options are mutually exclusive")
# Allow to define specific ruby executable. If not, take just 'ruby' # Allow to define specific ruby executable. If not, take just 'ruby'
self.ruby_executable = options.get('ruby-executable', 'ruby') self.ruby_executable = options.get('ruby-executable', 'ruby')
...@@ -67,17 +66,14 @@ class Recipe(object): ...@@ -67,17 +66,14 @@ class Recipe(object):
try: try:
return subprocess.check_output(cmd, env=env, universal_newlines=True) return subprocess.check_output(cmd, env=env, universal_newlines=True)
except OSError as e: except OSError as e:
raise zc.buildout.UserError( raise UserError('System error, command failed: %s: %s' % (e, cmd))
'System error, command failed: %s: %s' % (e, cmd))
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
self.log.error(e.output) self.log.error(e.output)
if e.returncode < 0: if e.returncode < 0:
raise zc.buildout.UserError( raise UserError('System error, command received signal %s: %s'
'System error, command received signal %s: %s' % (-e.returncode, e.cmd))
% (-e.returncode, e.cmd)
)
elif e.returncode > 0: elif e.returncode > 0:
raise zc.buildout.UserError( raise UserError(
'System error, command failed with exit code %s: %s' 'System error, command failed with exit code %s: %s'
% (e.returncode, e.cmd) % (e.returncode, e.cmd)
) )
...@@ -124,11 +120,11 @@ class Recipe(object): ...@@ -124,11 +120,11 @@ class Recipe(object):
% (' '.join(cons_dict.values()), dep_dict['gemname'], gemname) % (' '.join(cons_dict.values()), dep_dict['gemname'], gemname)
) )
raise zc.buildout.UserError( raise UserError(
'Configuration error, version %s for gem %s ' 'Configuration error, version %s for gem %s '
'does not satisfy dependency constraint %s of gem %s' 'does not satisfy dependency constraint %s of gem %s'
% (dep_dict['version'], dep_dict['gemname'], % (dep_dict['version'], dep_dict['gemname'],
' '.join(cons_dict.values()), gemname) ' '.join(cons_dict.values()), gemname)
) )
def _join_paths(self, *paths): def _join_paths(self, *paths):
...@@ -141,10 +137,8 @@ class Recipe(object): ...@@ -141,10 +137,8 @@ class Recipe(object):
map(strip, line.split('=', 1)) for line in env map(strip, line.split('=', 1)) for line in env
]]) ]])
except ValueError: # Unpacking impossible except ValueError: # Unpacking impossible
raise zc.buildout.UserError( raise UserError('Configuration error, '
'Configuration error, ' 'every environment line should contain a "=" sign')
'every environment line should contain a "=" sign'
)
return env return env
def _get_env(self): def _get_env(self):
...@@ -195,7 +189,7 @@ class Recipe(object): ...@@ -195,7 +189,7 @@ class Recipe(object):
f.close() f.close()
if r: if r:
return url or r.group(0), r.group(1) return url or r.group(0), r.group(1)
raise zc.buildout.UserError("Can't find rubygems version.") raise UserError("Can't find rubygems version.")
def _install_rubygems(self, url, version): def _install_rubygems(self, url, version):
srcdir = os.path.join(self.buildout['buildout']['parts-directory'], srcdir = os.path.join(self.buildout['buildout']['parts-directory'],
...@@ -204,8 +198,7 @@ class Recipe(object): ...@@ -204,8 +198,7 @@ class Recipe(object):
'url': url, 'url': url,
'destination': srcdir, 'destination': srcdir,
} }
recipe = Download(self.buildout, self.name, options) Download(self.buildout, self.name, options).install()
recipe.install()
current_dir = os.getcwd() current_dir = os.getcwd()
os.chdir(srcdir) os.chdir(srcdir)
...@@ -313,7 +306,7 @@ class Recipe(object): ...@@ -313,7 +306,7 @@ class Recipe(object):
url, version = self._get_rubygems_url_and_version() url, version = self._get_rubygems_url_and_version()
if int(version.split(".")[0]) < 2: if int(version.split(".")[0]) < 2:
raise zc.buildout.UserError("Rubygems version must be >= 2.0.0") raise UserError("Rubygems version must be >= 2.0.0")
self._install_rubygems(url, version) self._install_rubygems(url, version)
gem_executable = glob.glob(os.path.join(bindir, 'gem*'))[0] gem_executable = glob.glob(os.path.join(bindir, 'gem*'))[0]
...@@ -322,7 +315,7 @@ class Recipe(object): ...@@ -322,7 +315,7 @@ class Recipe(object):
for gem_dict in gem_dict_list: for gem_dict in gem_dict_list:
if self.deployment: if self.deployment:
if 'version' not in gem_dict: if 'version' not in gem_dict:
raise zc.buildout.UserError( raise UserError(
'Configuration error, ' 'Configuration error, '
'version for gem %s is missing' % gem_dict['gemname'] 'version for gem %s is missing' % gem_dict['gemname']
) )
...@@ -333,7 +326,7 @@ class Recipe(object): ...@@ -333,7 +326,7 @@ class Recipe(object):
match = [gem_d for gem_d in gem_dict_list match = [gem_d for gem_d in gem_dict_list
if dep_dict['gemname'] == gem_d['gemname']] if dep_dict['gemname'] == gem_d['gemname']]
if not match: if not match:
raise zc.buildout.UserError( raise UserError(
'Configuration error, ' 'Configuration error, '
'version for dependency %s is missing' 'version for dependency %s is missing'
% dep_dict['gemname'] % dep_dict['gemname']
......
...@@ -13,7 +13,7 @@ import re ...@@ -13,7 +13,7 @@ import re
from six import BytesIO from six import BytesIO
import zc.buildout from zc.buildout import UserError
import rubygems import rubygems
...@@ -135,8 +135,7 @@ class RubyGemsTestCase(unittest.TestCase): ...@@ -135,8 +135,7 @@ class RubyGemsTestCase(unittest.TestCase):
class RubyGemsDefaultTestCase(RubyGemsTestCase): class RubyGemsDefaultTestCase(RubyGemsTestCase):
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
def test_success(self, path, patches, buildout, name, options, version): def test_success(self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options) rubygems.Recipe(buildout, name, options).install()
recipe.install()
expected_install_arg_list_list = [ expected_install_arg_list_list = [
[ [
...@@ -151,7 +150,7 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase): ...@@ -151,7 +150,7 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
@fixture({'recipe': {}}) @fixture({'recipe': {}})
def test_missing_gems(self, path, patches, buildout, name, options, version): def test_missing_gems(self, path, patches, buildout, name, options, version):
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
"Configuration error, 'gems' option is missing", "Configuration error, 'gems' option is missing",
rubygems.Recipe, buildout, name, options rubygems.Recipe, buildout, name, options
) )
...@@ -159,48 +158,43 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase): ...@@ -159,48 +158,43 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
def test_oserror(self, path, patches, buildout, name, options, version): def test_oserror(self, path, patches, buildout, name, options, version):
patches['check_output'].side_effect = OSError patches['check_output'].side_effect = OSError
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'System error, command failed: .*', 'System error, command failed: .*',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
def test_signal_received(self, path, patches, buildout, name, options, version): def test_signal_received(self, path, patches, buildout, name, options, version):
exception = subprocess.CalledProcessError(-1, '') exception = subprocess.CalledProcessError(-1, '')
patches['check_output'].side_effect = exception patches['check_output'].side_effect = exception
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'System error, command received signal 1: .*', 'System error, command received signal 1: .*',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
def test_non_zero_exitcode(self, path, patches, buildout, name, options, version): def test_non_zero_exitcode(self, path, patches, buildout, name, options, version):
exception = subprocess.CalledProcessError(1, '') exception = subprocess.CalledProcessError(1, '')
patches['check_output'].side_effect = exception patches['check_output'].side_effect = exception
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'System error, command failed with exit code 1: .*', 'System error, command failed with exit code 1: .*',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
def test_update(self, path, patches, buildout, name, options, version): def test_update(self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options) rubygems.Recipe(buildout, name, options).update()
recipe.update()
@fixture({'recipe': {'gems': 'sass', 'environment': 'invalid'}}) @fixture({'recipe': {'gems': 'sass', 'environment': 'invalid'}})
def test_invalid_environment(self, path, patches, buildout, name, options, version): def test_invalid_environment(self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, ' 'Configuration error, '
'every environment line should contain a "=" sign', 'every environment line should contain a "=" sign',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@fixture({'recipe': { @fixture({'recipe': {
...@@ -209,21 +203,19 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase): ...@@ -209,21 +203,19 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
% RUBYGEMS_DEFAULT_VERSION, % RUBYGEMS_DEFAULT_VERSION,
}}) }})
def test_version_from_url(self, path, patches, buildout, name, options, version): def test_version_from_url(self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options) rubygems.Recipe(buildout, name, options).install()
recipe.install()
@fixture({'recipe': {'gems': 'sass'}, 'version': RUBYGEMS_DEFAULT_VERSION}) @fixture({'recipe': {'gems': 'sass'}, 'version': RUBYGEMS_DEFAULT_VERSION})
def test_version(self, path, patches, buildout, name, options, version): def test_version(self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options) rubygems.Recipe(buildout, name, options).install()
recipe.install()
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
def test_no_version(self, path, patches, buildout, name, options, version): def test_no_version(self, path, patches, buildout, name, options, version):
patches['urlopen'].return_value = BytesIO(b'') patches['urlopen'].return_value = BytesIO(b'')
recipe = rubygems.Recipe(buildout, name, options) self.assertRaisesRegexp(
self.assertRaisesRegexp(zc.buildout.UserError, UserError,
"Can't find rubygems version.", "Can't find rubygems version.",
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@fixture({'recipe': {'gems': 'sass'}}) @fixture({'recipe': {'gems': 'sass'}})
...@@ -234,9 +226,8 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase): ...@@ -234,9 +226,8 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
@fixture({'recipe': {'gems': 'sass==1.0'}}) @fixture({'recipe': {'gems': 'sass==1.0'}})
def test_pinned_versions(self, path, patches, buildout, name, options, version): def test_pinned_versions(self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
touch(path / 'rubygems/bin/gem') touch(path / 'rubygems/bin/gem')
recipe.install() rubygems.Recipe(buildout, name, options).install()
args = patches['check_output'].mock_calls[1][1] args = patches['check_output'].mock_calls[1][1]
for arg in args[0]: for arg in args[0]:
...@@ -256,8 +247,7 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase): ...@@ -256,8 +247,7 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
rubygems_setup_output = fd.read() rubygems_setup_output = fd.read()
patches['check_output'].return_value = rubygems_setup_output patches['check_output'].return_value = rubygems_setup_output
recipe = rubygems.Recipe(buildout, name, options) rubygems.Recipe(buildout, name, options).install()
recipe.install()
@fixture({'recipe': { @fixture({'recipe': {
'gems': 'sass', 'gems': 'sass',
...@@ -267,7 +257,7 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase): ...@@ -267,7 +257,7 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
}}) }})
def test_version_and_url(self, path, patches, buildout, name, options, version): def test_version_and_url(self, path, patches, buildout, name, options, version):
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
"Configuration error, 'url' and 'version' options are mutually exclusive", "Configuration error, 'url' and 'version' options are mutually exclusive",
rubygems.Recipe, buildout, name, options rubygems.Recipe, buildout, name, options
) )
...@@ -334,32 +324,29 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -334,32 +324,29 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
@deployment_fixture({'recipe': {'gems': 'sass'}}) @deployment_fixture({'recipe': {'gems': 'sass'}})
def test_deployment_not_pinned_version_error( def test_deployment_not_pinned_version_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version for gem sass is missing', 'Configuration error, version for gem sass is missing',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': {'gems': 'rash==0.1.0'}}) @deployment_fixture({'recipe': {'gems': 'rash==0.1.0'}})
def test_deployment_not_pinned_dependency_error( def test_deployment_not_pinned_dependency_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version for dependency hashie is missing', 'Configuration error, version for dependency hashie is missing',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': {'gems': 'rash==0.1.0 hashie==0.3.0'}}) @deployment_fixture({'recipe': {'gems': 'rash==0.1.0 hashie==0.3.0'}})
def test_deployment_more_or_equal_constraint_error( def test_deployment_more_or_equal_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 0.3.0 for gem hashie ' 'Configuration error, version 0.3.0 for gem hashie '
'does not satisfy dependency constraint >= 0.3.1 of gem rash', 'does not satisfy dependency constraint >= 0.3.1 of gem rash',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': {'gems': 'rash==0.1.0 hashie==0.3.1'}}) @deployment_fixture({'recipe': {'gems': 'rash==0.1.0 hashie==0.3.1'}})
...@@ -371,12 +358,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -371,12 +358,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
@deployment_fixture({'recipe': {'gems': 'rash==0.3.0 hashie==1.1.0'}}) @deployment_fixture({'recipe': {'gems': 'rash==0.3.0 hashie==1.1.0'}})
def test_deployment_similar_constraint_error( def test_deployment_similar_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 1.1.0 for gem hashie ' 'Configuration error, version 1.1.0 for gem hashie '
'does not satisfy dependency constraint < 1.1 of gem rash', 'does not satisfy dependency constraint < 1.1 of gem rash',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': {'gems': 'rash==0.3.0 hashie==1.0.0'}}) @deployment_fixture({'recipe': {'gems': 'rash==0.3.0 hashie==1.0.0'}})
...@@ -393,13 +379,12 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -393,13 +379,12 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
}}) }})
def test_deployment_more_or_equal_constraint_error( def test_deployment_more_or_equal_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 9.0.2 for gem cucumber-messages ' 'Configuration error, version 9.0.2 for gem cucumber-messages '
'does not satisfy dependency constraint >= 9.0.3 ' 'does not satisfy dependency constraint >= 9.0.3 '
'of gem cucumber-gherkin', 'of gem cucumber-gherkin',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': { @deployment_fixture({'recipe': {
...@@ -416,12 +401,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -416,12 +401,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
@deployment_fixture({'recipe': {'gems': 'hoe==3.4.0 rake==11.0.0'}}) @deployment_fixture({'recipe': {'gems': 'hoe==3.4.0 rake==11.0.0'}})
def test_deployment_less_constraint_error( def test_deployment_less_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 11.0.0 for gem rake ' 'Configuration error, version 11.0.0 for gem rake '
'does not satisfy dependency constraint < 11.0 of gem hoe', 'does not satisfy dependency constraint < 11.0 of gem hoe',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': {'gems': 'hoe==3.4.0 rake==10.0.1'}}) @deployment_fixture({'recipe': {'gems': 'hoe==3.4.0 rake==10.0.1'}})
...@@ -436,12 +420,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -436,12 +420,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
}}) }})
def test_deployment_not_pinned_subdependency_error( def test_deployment_not_pinned_subdependency_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version for dependency ' 'Configuration error, version for dependency '
'cucumber-messages is missing', 'cucumber-messages is missing',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': { @deployment_fixture({'recipe': {
...@@ -463,13 +446,12 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -463,13 +446,12 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
}}) }})
def test_deployment_subdependency_constraint_error( def test_deployment_subdependency_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 12.2.0 for gem cucumber-messages ' 'Configuration error, version 12.2.0 for gem cucumber-messages '
'does not satisfy dependency constraint >= 12.3 ' 'does not satisfy dependency constraint >= 12.3 '
'of gem cucumber-gherkin', 'of gem cucumber-gherkin',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': { @deployment_fixture({'recipe': {
...@@ -493,12 +475,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -493,12 +475,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
}}) }})
def test_deployment_similar_second_constraint_error( def test_deployment_similar_second_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 15.0.0 for gem cucumber-gherkin ' 'Configuration error, version 15.0.0 for gem cucumber-gherkin '
'does not satisfy dependency constraint < 15 of gem cucumber-core', 'does not satisfy dependency constraint < 15 of gem cucumber-core',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': { @deployment_fixture({'recipe': {
...@@ -517,12 +498,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase): ...@@ -517,12 +498,11 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
}}) }})
def test_deployment_version_exclusion_constraint_error( def test_deployment_version_exclusion_constraint_error(
self, path, patches, buildout, name, options, version): self, path, patches, buildout, name, options, version):
recipe = rubygems.Recipe(buildout, name, options)
self.assertRaisesRegexp( self.assertRaisesRegexp(
zc.buildout.UserError, UserError,
'Configuration error, version 1.0.0 for gem hashie ' 'Configuration error, version 1.0.0 for gem hashie '
'does not satisfy dependency constraint != 1.0.0 of gem sass', 'does not satisfy dependency constraint != 1.0.0 of gem sass',
recipe.install rubygems.Recipe(buildout, name, options).install,
) )
@deployment_fixture({'recipe': { @deployment_fixture({'recipe': {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment