Skip to content

Commit

Permalink
Move @skipIf to parent classes
Browse files Browse the repository at this point in the history
Related to saltstack#27089 Saltcloud virtualbox provider
  • Loading branch information
LoveIsGrief committed Feb 10, 2016
1 parent 002ce06 commit e5f8227
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/integration/cloud/helpers/virtualbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import unittest
from unittest2 import skipIf

import integration
from integration.cloud.helpers import random_name
Expand All @@ -26,6 +27,7 @@
info = log.info


@skipIf(virtualbox.HAS_LIBS is False, 'virtualbox has to be installed')
class VirtualboxTestCase(unittest.TestCase):
def setUp(self):
self.vbox = virtualbox.vb_get_box()
Expand All @@ -43,6 +45,7 @@ def assertMachineDoesNotExist(self, name, msg=None):
self.assertRaisesRegexp(Exception, "Could not find a registered machine", self.vbox.findMachine, name)


@skipIf(virtualbox.HAS_LIBS is False, 'salt-cloud requires virtualbox to be installed')
class VirtualboxCloudTestCase(integration.ShellCase):
def run_cloud(self, arg_str, catch_stderr=False, timeout=None):
"""
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/cloud/providers/virtualbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import integration
from salt.config import cloud_providers_config, vm_profiles_config
from utils.virtualbox import vb_xpcom_to_attribute_dict, vb_clone_vm, vb_destroy_machine, vb_create_machine, \
vb_get_box, vb_machine_exists, HAS_LIBS, XPCOM_ATTRIBUTES, vb_start_vm, vb_stop_vm, \
vb_get_box, vb_machine_exists, XPCOM_ATTRIBUTES, vb_start_vm, vb_stop_vm, \
vb_get_network_addresses, vb_wait_for_network_address, machine_get_machinestate_str

# Setup logging
Expand All @@ -46,7 +46,6 @@
]


@skipIf(HAS_LIBS is False, 'salt-cloud requires virtualbox to be installed')
class VirtualboxProviderTest(VirtualboxCloudTestCase):
"""
Integration tests for the Virtualbox cloud provider using the Virtualbox driver
Expand Down

0 comments on commit e5f8227

Please sign in to comment.