# Path: tests/testlib.py
# class NoRestartRequiredError(Exception):
# class WaitTimedOutError(Exception):
# class SDKTestCase(unittest.TestCase):
# def to_bool(x):
# def tmpname():
# def wait(predicate, timeout=60, pause_time=0.5):
#     def assertEventuallyTrue(self, predicate, timeout=30, pause_time=0.5,
#                              timeout_message="Operation timed out."):
#     def check_content(self, entity, **kwargs):
#     def check_entity(self, entity):
#     def clear_restart_message(self):
#     def fake_splunk_version(self, version):
#     def install_app_from_collection(self, name):
#     def app_collection_installed(self):
#     def pathInApp(self, appName, pathComponents):
#     def uncheckedRestartSplunk(self, timeout=240):
#     def restartSplunk(self, timeout=240):
#     def setUpClass(cls):
#     def setUp(self):
#     def tearDown(self):


import datetime
import logging
import splunklib.client as client
import pytest
        import unittest2 as unittest
        import unittest
from tests import testlib
from time import sleep
from splunklib.six.moves import zip
                           'restart_on_searchpeer_add',
                           'run_on_startup',
                           'search',
                           'action.email',
                           'action.populate_lookup',
                           'action.rss',
                           'action.script',
                           'action.summary_index']
        for f in expected_fields:
            saved_search[f]
        self.assertGreaterEqual(saved_search.suppressed, 0)
        self.assertGreaterEqual(saved_search['suppressed'], 0)
        is_scheduled = saved_search.content['is_scheduled']
        self.assertTrue(is_scheduled == '1' or is_scheduled == '0')
        is_visible = saved_search.content['is_visible']
        self.assertTrue(is_visible == '1' or is_visible == '0')

    def test_create(self):
        self.assertTrue(self.saved_search_name in self.service.saved_searches)
        self.check_saved_search(self.saved_search)

    def test_delete(self):
        self.assertTrue(self.saved_search_name in self.service.saved_searches)
        self.service.saved_searches.delete(self.saved_search_name)
        self.assertFalse(self.saved_search_name in self.service.saved_searches)
        self.assertRaises(client.HTTPError,
                          self.saved_search.refresh)


    def test_update(self):

# Path: tests/testlib.py
# class NoRestartRequiredError(Exception):
# class WaitTimedOutError(Exception):
# class SDKTestCase(unittest.TestCase):
# def to_bool(x):
# def tmpname():
# def wait(predicate, timeout=60, pause_time=0.5):
#     def assertEventuallyTrue(self, predicate, timeout=30, pause_time=0.5,
#                              timeout_message="Operation timed out."):
#     def check_content(self, entity, **kwargs):
#     def check_entity(self, entity):
#     def clear_restart_message(self):
#     def fake_splunk_version(self, version):
#     def install_app_from_collection(self, name):
#     def app_collection_installed(self):
#     def pathInApp(self, appName, pathComponents):
#     def uncheckedRestartSplunk(self, timeout=240):
#     def restartSplunk(self, timeout=240):
#     def setUpClass(cls):
#     def setUp(self):
#     def tearDown(self):


# Path: tests/test_saved_search.py
import datetime
import logging
import splunklib.client as client
import pytest
        import unittest2 as unittest
        import unittest
from tests import testlib
from time import sleep
from splunklib.six.moves import zip

                           'restart_on_searchpeer_add',
                           'run_on_startup',
                           'search',
                           'action.email',
                           'action.populate_lookup',
                           'action.rss',
                           'action.script',
                           'action.summary_index']
        for f in expected_fields:
            saved_search[f]
        self.assertGreaterEqual(saved_search.suppressed, 0)
        self.assertGreaterEqual(saved_search['suppressed'], 0)
        is_scheduled = saved_search.content['is_scheduled']
        self.assertTrue(is_scheduled == '1' or is_scheduled == '0')
        is_visible = saved_search.content['is_visible']
        self.assertTrue(is_visible == '1' or is_visible == '0')

    def test_create(self):
        self.assertTrue(self.saved_search_name in self.service.saved_searches)
        self.check_saved_search(self.saved_search)

    def test_delete(self):
        self.assertTrue(self.saved_search_name in self.service.saved_searches)
        self.service.saved_searches.delete(self.saved_search_name)
        self.assertFalse(self.saved_search_name in self.service.saved_searches)
        self.assertRaises(client.HTTPError,
                          self.saved_search.refresh)


    def test_update(self):

        is_visible = testlib.to_bool(self.saved_search['is_visible'])