Merge pull request #1530 from dcolish/develop

Fix test.integration.states.host. Make master_config and minion_config a...
This commit is contained in:
Thomas S Hatch 2012-06-30 14:03:56 -07:00
commit ed84eda01f
3 changed files with 14 additions and 14 deletions

View File

@ -183,6 +183,7 @@ class ModuleCase(TestCase):
'''
return self.run_function('state.single', [function], **kwargs)
@property
def minion_opts(self):
'''
Return the options used for the minion
@ -194,6 +195,7 @@ class ModuleCase(TestCase):
)
)
@property
def master_opts(self):
'''
Return the options used for the minion

View File

@ -18,14 +18,14 @@ class TestModulesGrains(integration.ModuleCase):
'''
grains.items
'''
opts = self.minion_opts()
opts = self.minion_opts
self.assertEqual(self.run_function('grains.items')['test_grain'], opts['grains']['test_grain'])
def test_item(self):
'''
grains.item
'''
opts = self.minion_opts()
opts = self.minion_opts
self.assertEqual(self.run_function('grains.item', ['test_grain']), opts['grains']['test_grain'])
def test_ls(self):

View File

@ -13,21 +13,19 @@ HFILE = os.path.join(integration.TMP, 'hosts')
class HostTest(integration.ModuleCase):
def setUp(self):
shutil.copy(os.path.join(
integration.INTEGRATION_TEST_DIR, 'files', 'hosts'),
self.master_opts['hosts.file'])
shutil.copy(os.path.join(
integration.INTEGRATION_TEST_DIR, 'files', 'hosts'),
self.minion_opts['hosts.file'])
def tearDown(self):
os.remove(self.master_opts['hosts.file'])
os.remove(self.minion_opts['hosts.file'])
'''
Validate the host state
'''
def setUp(self):
shutil.copyfile(os.path.join(integration.FILES, 'hosts'), HFILE)
super(HostTest, self).setUp()
def tearDown(self):
if os.path.exists(HFILE):
os.remove(HFILE)
super(HostTest, self).tearDown()
def test_present(self):
'''
host.present