def _test_boolean_option(self, option):

        rebase_environment('app_without_logging_configuration')
        command = StubbedSearchCommand()

        # show_configuration accepts Splunk boolean values

        boolean_values = {
            '0': False, '1': True,
            'f': False, 't': True,
            'n': False, 'y': True,
            'no': False, 'yes': True,
            'false': False, 'true': True}

        for value in boolean_values:
            for variant in value, value.capitalize(), value.upper():
                for s in variant, bytes(variant):
                    option.fset(command, s)
                    self.assertEquals(option.fget(command), boolean_values[value])

        option.fset(command, None)
        self.assertEquals(option.fget(command), None)

        for value in 13, b'bytes', 'string', object():
            try:
                option.fset(command, value)
            except __HOLE__:
                pass
            except BaseException as error:
                self.fail('Expected ValueError when setting {}={}, but {} was raised'.format(
                    option.name, repr(value), type(error)))
            else:
                self.fail('Expected ValueError, but {}={} was accepted.'.format(
                    option.name, repr(option.fget(command))))

        return
dataset/ETHPy150Open splunk/splunk-sdk-python/tests/searchcommands/test_builtin_options.py/TestBuiltinOptions._test_boolean_option