mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Remove un-useful test modules
This commit is contained in:
parent
89733e6e40
commit
8a2c5a4eee
2 changed files with 0 additions and 157 deletions
|
@ -1,93 +0,0 @@
|
|||
# # -*- coding: utf-8 -*-
|
||||
|
||||
# # Import Python libs
|
||||
# from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
# # Import Salt Testing libs
|
||||
# from tests.support.unit import skipIf, TestCase
|
||||
# from tests.support.mock import MagicMock, patch
|
||||
|
||||
# # Import salt libs
|
||||
# import salt.modules.cyg as cyg
|
||||
|
||||
# cyg.__salt__ = {}
|
||||
|
||||
|
||||
# class TestcygModule(TestCase):
|
||||
|
||||
# def test__get_cyg_dir(self):
|
||||
# self.assertEqual(cyg._get_cyg_dir(), 'c:\\cygwin64')
|
||||
# self.assertEqual(cyg._get_cyg_dir('x86_64'), 'c:\\cygwin64')
|
||||
# self.assertEqual(cyg._get_cyg_dir('x86'), 'c:\\cygwin')
|
||||
|
||||
# def test_cyg_install(self):
|
||||
# mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
# with patch.dict(cyg.__salt__,
|
||||
# {'cmd.run_all': mock}):
|
||||
# cyg._get_cyg_dir()
|
||||
# mock.assert_called_once_with('cyg install dos2unix')
|
||||
|
||||
# mock = MagicMock(return_value=None)
|
||||
# with patch.dict(cyg.__salt__,
|
||||
# {'rvm.is_installed': MagicMock(return_value=True),
|
||||
# 'rbenv.is_installed': MagicMock(return_value=False),
|
||||
# 'rvm.do': mock}):
|
||||
# cyg._get_cyg_dir('install dos2unix', ruby='1.9.3')
|
||||
# mock.assert_called_once_with(
|
||||
# '1.9.3', 'cyg install dos2unix'
|
||||
# )
|
||||
|
||||
# mock = MagicMock(return_value=None)
|
||||
# with patch.dict(cyg.__salt__,
|
||||
# {'rvm.is_installed': MagicMock(return_value=False),
|
||||
# 'rbenv.is_installed': MagicMock(return_value=True),
|
||||
# 'rbenv.do': mock}):
|
||||
# cyg._get_cyg_dir('install dos2unix')
|
||||
# mock.assert_called_once_with(
|
||||
# 'cyg install dos2unix'
|
||||
# )
|
||||
|
||||
# def test_install_pre(self):
|
||||
# mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
# with patch.dict(cyg.__salt__,
|
||||
# {'rvm.is_installed': MagicMock(return_value=False),
|
||||
# 'rbenv.is_installed': MagicMock(return_value=False),
|
||||
# 'cmd.run_all': mock}):
|
||||
# cyg.install('dos2unix', pre_releases=True)
|
||||
# mock.assert_called_once_with(
|
||||
# 'cyg install dos2unix --no-rdoc --no-ri --pre'
|
||||
# )
|
||||
|
||||
# def test_list(self):
|
||||
# output = '''
|
||||
# actionmailer (2.3.14)
|
||||
# actionpack (2.3.14)
|
||||
# activerecord (2.3.14)
|
||||
# activeresource (2.3.14)
|
||||
# activesupport (3.0.5, 2.3.14)
|
||||
# rake (0.9.2, 0.8.7)
|
||||
# responds_to_parent (1.0.20091013)
|
||||
# sass (3.1.15, 3.1.7)
|
||||
# '''
|
||||
# mock = MagicMock(return_value=output)
|
||||
# with patch.object(cyg, '_cyg', new=mock):
|
||||
# self.assertEqual(
|
||||
# {'actionmailer': ['2.3.14'],
|
||||
# 'actionpack': ['2.3.14'],
|
||||
# 'activerecord': ['2.3.14'],
|
||||
# 'activeresource': ['2.3.14'],
|
||||
# 'activesupport': ['3.0.5', '2.3.14'],
|
||||
# 'rake': ['0.9.2', '0.8.7'],
|
||||
# 'responds_to_parent': ['1.0.20091013'],
|
||||
# 'sass': ['3.1.15', '3.1.7']},
|
||||
# cyg.list_())
|
||||
|
||||
# def test_sources_list(self):
|
||||
# output = '''*** CURRENT SOURCES ***
|
||||
|
||||
# http://rubycygs.org/
|
||||
# '''
|
||||
# mock = MagicMock(return_value=output)
|
||||
# with patch.object(cyg, '_cyg', new=mock):
|
||||
# self.assertEqual(
|
||||
# ['http://rubycygs.org/'], cyg.sources_list())
|
|
@ -1,64 +0,0 @@
|
|||
# # -*- coding: utf-8 -*-
|
||||
# # Import Python Libs
|
||||
# from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
# # Import Salt Testing libs
|
||||
# from tests.support.unit import skipIf, TestCase
|
||||
# from tests.support.mock import MagicMock, patch
|
||||
|
||||
# # Late import so mock can do its job
|
||||
# import salt.states.cyg as cyg
|
||||
# cyg.__salt__ = {}
|
||||
# cyg.__opts__ = {'test': False}
|
||||
|
||||
|
||||
# class TestGemState(TestCase):
|
||||
|
||||
# def test_installed(self):
|
||||
# gems = {'foo': ['1.0'], 'bar': ['2.0']}
|
||||
# gem_list = MagicMock(return_value=gems)
|
||||
# gem_install_succeeds = MagicMock(return_value=True)
|
||||
# gem_install_fails = MagicMock(return_value=False)
|
||||
|
||||
# with patch.dict(gem.__salt__, {'gem.list': gem_list}):
|
||||
# with patch.dict(gem.__salt__,
|
||||
# {'gem.install': gem_install_succeeds}):
|
||||
# ret = gem.installed('foo')
|
||||
# self.assertEqual(True, ret['result'])
|
||||
# ret = gem.installed('quux')
|
||||
# self.assertEqual(True, ret['result'])
|
||||
# gem_install_succeeds.assert_called_once_with(
|
||||
# 'quux', pre_releases=False, ruby=None, runas=None,
|
||||
# version=None, rdoc=False, ri=False
|
||||
# )
|
||||
|
||||
# with patch.dict(gem.__salt__,
|
||||
# {'gem.install': gem_install_fails}):
|
||||
# ret = gem.installed('quux')
|
||||
# self.assertEqual(False, ret['result'])
|
||||
# gem_install_fails.assert_called_once_with(
|
||||
# 'quux', pre_releases=False, ruby=None, runas=None,
|
||||
# version=None, rdoc=False, ri=False
|
||||
# )
|
||||
|
||||
# def test_removed(self):
|
||||
# gems = ['foo', 'bar']
|
||||
# gem_list = MagicMock(return_value=gems)
|
||||
# gem_uninstall_succeeds = MagicMock(return_value=True)
|
||||
# gem_uninstall_fails = MagicMock(return_value=False)
|
||||
# with patch.dict(gem.__salt__, {'gem.list': gem_list}):
|
||||
# with patch.dict(gem.__salt__,
|
||||
# {'gem.uninstall': gem_uninstall_succeeds}):
|
||||
# ret = gem.removed('quux')
|
||||
# self.assertEqual(True, ret['result'])
|
||||
# ret = gem.removed('foo')
|
||||
# self.assertEqual(True, ret['result'])
|
||||
# gem_uninstall_succeeds.assert_called_once_with(
|
||||
# 'foo', None, runas=None)
|
||||
|
||||
# with patch.dict(gem.__salt__,
|
||||
# {'gem.uninstall': gem_uninstall_fails}):
|
||||
# ret = gem.removed('bar')
|
||||
# self.assertEqual(False, ret['result'])
|
||||
# gem_uninstall_fails.assert_called_once_with(
|
||||
# 'bar', None, runas=None)
|
Loading…
Add table
Reference in a new issue