Merge pull request #37213 from cachedout/more_salttesting_fixes

More salttesting fixes
This commit is contained in:
Mike Place 2016-10-25 16:53:33 +09:00 committed by GitHub
commit 6aaf6bf399
3 changed files with 18 additions and 2 deletions

View File

@ -87,12 +87,18 @@ class SaltnadoTestCase(integration.ModuleCase, AsyncHTTPTestCase):
return self.auth.mk_token(self.auth_creds_dict)
def setUp(self):
super(SaltnadoTestCase, self).setUp()
try:
super(SaltnadoTestCase, self).setUp()
except NotImplementedError:
pass
self.async_timeout_prev = os.environ.pop('ASYNC_TEST_TIMEOUT', None)
os.environ['ASYNC_TEST_TIMEOUT'] = str(30)
def tearDown(self):
super(SaltnadoTestCase, self).tearDown()
try:
super(SaltnadoTestCase, self).tearDown()
except AttributeError:
pass
if self.async_timeout_prev is None:
os.environ.pop('ASYNC_TEST_TIMEOUT', None)
else:

View File

@ -73,6 +73,14 @@ class BaseTCPReqCase(TestCase):
cls.server_channel.close()
del cls.server_channel
@classmethod
@tornado.gen.coroutine
def _handle_payload(cls, payload):
'''
TODO: something besides echo
'''
raise tornado.gen.Return((payload, {'fun': 'send_clear'}))
@skipIf(salt.utils.is_darwin(), 'hanging test suite on MacOS')
class ClearReqTestCases(BaseTCPReqCase, ReqChannelMixin):

View File

@ -111,6 +111,8 @@ if HAS_CHERRYPY:
}
def setUp(self):
if not hasattr(self, '_cp_config'):
self._cp_config = {}
Root._cp_config = self._cp_config
root = Root()