Lint develop branch

This commit is contained in:
rallytime 2016-03-28 11:37:57 -06:00
parent 6ac3f4d0b4
commit a659c3be50
2 changed files with 20 additions and 15 deletions

View File

@ -32,9 +32,8 @@ In order to have the returner apply to all minions:
ext_job_cache: elasticsearch
'''
from __future__ import absolute_import
# Import Python libs
from __future__ import absolute_import
from datetime import tzinfo, datetime, timedelta
import uuid
import logging
@ -51,6 +50,7 @@ log = logging.getLogger(__name__)
def __virtual__():
return __virtualname__
def _ensure_index(index):
index_exists = __salt__['elasticsearch.index_exists'](index)
if not index_exists:
@ -70,7 +70,6 @@ def _ensure_index(index):
__salt__['elasticsearch.alias_create']('{0}-v1'.format(index), index)
def returner(ret):
'''
Process the return from Salt

30
tests/unit/modules/k8s_test.py Executable file → Normal file
View File

@ -1,21 +1,26 @@
# Import pytohn libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
ensure_in_syspath('../../')
# from unittest import TestCase
# -*- coding: utf-8 -*-
'''
Unit Tests for the k8s execution module.
'''
# Import Salt execution module to test
# from salt.modules import k8s
# FIXME
import salt.modules.k8s as k8s
# Import Python libs
from __future__ import absolute_import
import json
import hashlib
import base64
import time
from subprocess import Popen, PIPE
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
ensure_in_syspath('../../')
# Import Salt libs
import salt.modules.k8s as k8s
TestCase.maxDiff = None
@ -294,7 +299,7 @@ spec:
@skip_if_binaries_missing(['kubectl'])
class TestK8SLimitrange(TestCase):
class TestK8SLimitRange(TestCase):
def setUp(self):
hash = hashlib.sha1()
@ -391,6 +396,7 @@ spec:
b = kubectl_out.get("metadata", {}).get("name", "b")
self.assertEqual(a, b)
if __name__ == '__main__':
from integration import run_tests
run_tests(TestK8SNamespace,