Beispiel #1
0
class AuthTests(object):

    def __init__(self):
        self.__client = config.api_client
        self.__auth = Auth()
        self.__nodeApi = Nodes()

    @before_class()
    def setup(self):
        """setup test environment"""
        self.__auth.enable()

    @after_class(always_run=True)
    def teardown(self):
        """ restore test environment """
        self.__auth.disable()

    # @test(groups=['enable-auth'])
    # def enable_auth(self):
    #     """ Testing enable auth """
    #     self.__auth.enable()

    @test(groups=['test-nodes-withauth'])
    def test_nodes(self):
        """ Testing GET:/nodes """
        self.__nodeApi.api1_1_nodes_get()
        nodes = loads(self.__client.last_response.data)
        LOG.debug(nodes, json=True)
        assert_not_equal(0, len(nodes), message='Node list was empty!')
Beispiel #2
0
 def __init__(self):
     self.__client = config.api_client
     self.__auth = Auth()
     self.__nodeApi = Nodes()