コード例 #1
0
    def setUp(self):
        self.opts = testlib.parse([], {}, ".splunkrc")
        self.service = client.Service(**self.opts.kwargs)

        # Skip these tests if running below Splunk 6.2, cookie-auth didn't exist before
        splver = self.service.splunk_version
        if splver[:2] < (6, 2):
            self.skipTest("Skipping cookie-auth tests, running in %d.%d.%d, this feature was added in 6.2+" % splver)
コード例 #2
0
    def setUp(self):
        self.opts = testlib.parse([], {}, ".splunkrc")
        self.service = client.Service(**self.opts.kwargs)

        # Skip these tests if running below Splunk 6.2, cookie-auth didn't exist before
        splver = self.service.splunk_version
        # TODO: Workaround the fact that skipTest is not defined by unittest2.TestCase
        if splver[:2] < (6, 2):
            self.skipTest("Skipping cookie-auth tests, running in %d.%d.%d, this feature was added in 6.2+" % splver)
コード例 #3
0
    def setUp(self):
        self.opts = testlib.parse([], {}, ".splunkrc")
        self.service = client.Service(**self.opts.kwargs)

        # Skip these tests if running below Splunk 6.2, cookie-auth didn't exist before
        splver = self.service.splunk_version
        if splver[:2] < (6, 2):
            self.skipTest(
                "Skipping cookie-auth tests, running in %d.%d.%d, this feature was added in 6.2+"
                % splver)
コード例 #4
0
    def setUp(self):
        self.opts = testlib.parse([], {}, ".splunkrc")
        opts = self.opts.kwargs.copy()
        opts["basic"] = True
        opts["username"] = self.opts.kwargs["username"]
        opts["password"] = self.opts.kwargs["password"]

        self.context = binding.connect(**opts)
        import splunklib.client as client
        service = client.Service(**opts)
コード例 #5
0
    def setUp(self):
        self.opts = testlib.parse([], {}, ".splunkrc")
        self.service = client.Service(**self.opts.kwargs)

        # Skip these tests if running below Splunk 6.2, cookie-auth didn't exist before
        splver = self.service.splunk_version
        # TODO: Workaround the fact that skipTest is not defined by unittest2.TestCase
        if splver[:2] < (6, 2):
            self.skipTest(
                "Skipping cookie-auth tests, running in %d.%d.%d, this feature was added in 6.2+"
                % splver)
コード例 #6
0
    def setUp(self):
        self.opts = testlib.parse([], {}, ".splunkrc")
        opts = self.opts.kwargs.copy()
        opts["basic"] = True
        opts["username"] = self.opts.kwargs["username"]
        opts["password"] = self.opts.kwargs["password"]

        self.context = binding.connect(**opts)
        import splunklib.client as client

        service = client.Service(**opts)
コード例 #7
0
ファイル: ptnodetest.py プロジェクト: 941design/ptTools
 def test_from_and_to_tuple_03(self):
     """Asserts equality of conversion from parsed parsetree back to
     tuple for whole library."""
     for py in python_library():
         sys.stdout.write('{}...'.format(py))
         pt = parse(py)
         root = parsetree.fromtuple(pt)
         leaves = root.leaves
         self.assertTupleEqual(pt, root.totuple())
         self.assertAllTrue([isinstance(n, TerminalNode) for n in leaves])
         self.assertAllTrue([isinstance(n, str) for n in leaves])            
         print('PASS')
コード例 #8
0
 def test_traversal_library(self):
     """Tests equivalent traversal behaviour for all files in
     library."""
     for py in python_library():
         sys.stdout.write('{}...'.format(py))
         pt = parse(py)
         root = parsetree.fromtuple(pt)
         tuple_iter = tupletraversal.preorder(pt)
         node_iter = root.preorder()            
         for t, n in zip(tuple_iter, node_iter):
             self.assertEqual(t, n)
         print('PASS')
コード例 #9
0
 def setUp(self):
     logging.info("%s", self.__class__.__name__)
     self.opts = testlib.parse([], {}, ".splunkrc")
     self.context = binding.connect(**self.opts.kwargs)
     logging.debug("Connected to splunkd.")
コード例 #10
0
 def setUp(self):
     logging.info("%s", self.__class__.__name__)
     self.opts = testlib.parse([], {}, ".splunkrc")
     self.context = binding.connect(**self.opts.kwargs)
     logging.debug("Connected to splunkd.")