Пример #1
0
 def test_installed(self):
     mock = MagicMock()
     with patch.object(rvm, '_check_rvm', return_value={'result': True}):
         with patch.object(rvm, '_check_and_install_ruby', new=mock):
             rvm.installed("1.9.3", default=True)
     mock.assert_called_once_with(
         {'result': True}, '1.9.3', True, runas=None)
Пример #2
0
 def test_installed(self):
     mock = MagicMock()
     with patch.object(rvm, '_check_rvm') as mock_method:
         mock_method.return_value = {'result': True}
         with patch.object(rvm, '_check_and_install_ruby', new=mock):
             rvm.installed('1.9.3', default=True)
     mock.assert_called_once_with(
         {'result': True}, '1.9.3', True, user=None, opts=None, env=None)
Пример #3
0
 def test_installed_with_opts(self):
     mock = MagicMock()
     with patch.object(rvm, '_check_rvm') as mock_method:
         mock_method.return_value = {'result': True}
         with patch.object(rvm, '_check_and_install_ruby', new=mock):
             rvm.installed('1.9.3', default=True, opts=[{'-C': '--enable-shared,--with-readline-dir=$HOME/.rvm/usr'}])
     mock.assert_called_once_with(
         {'result': True}, '1.9.3', True, user=None, opts=[{'-C': '--enable-shared,--with-readline-dir=$HOME/.rvm/usr'}], env=None)
Пример #4
0
 def test_installed(self):
     mock = MagicMock()
     with patch.object(rvm, "_check_rvm") as mock_method:
         mock_method.return_value = {"result": True}
         with patch.object(rvm, "_check_and_install_ruby", new=mock):
             rvm.installed("1.9.3", default=True)
     mock.assert_called_once_with(
         {"result": True}, "1.9.3", True, user=None, opts=None, env=None
     )
Пример #5
0
 def test_installed_with_env(self):
     mock = MagicMock()
     with patch.object(rvm, "_check_rvm") as mock_method:
         mock_method.return_value = {"result": True}
         with patch.object(rvm, "_check_and_install_ruby", new=mock):
             rvm.installed(
                 "1.9.3", default=True, env=[{"RUBY_CONFIGURE_OPTS": "--foobar"}]
             )
     mock.assert_called_once_with(
         {"result": True},
         "1.9.3",
         True,
         user=None,
         opts=None,
         env=[{"RUBY_CONFIGURE_OPTS": "--foobar"}],
     )
Пример #6
0
 def test_installed_with_opts(self):
     mock = MagicMock()
     with patch.object(rvm, "_check_rvm") as mock_method:
         mock_method.return_value = {"result": True}
         with patch.object(rvm, "_check_and_install_ruby", new=mock):
             rvm.installed(
                 "1.9.3",
                 default=True,
                 opts=[{"-C": "--enable-shared,--with-readline-dir=$HOME/.rvm/usr"}],
             )
     mock.assert_called_once_with(
         {"result": True},
         "1.9.3",
         True,
         user=None,
         opts=[{"-C": "--enable-shared,--with-readline-dir=$HOME/.rvm/usr"}],
         env=None,
     )