File: util.py

package info (click to toggle)
setools 4.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,600 kB
  • sloc: python: 24,485; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 656 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright 2020, Microsoft Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
from setools.checker import util


class TestCheckerUtil:

    def test_config_bool_value(self):
        """Test config_bool_value"""
        assert util.config_bool_value(" TrUe ")
        assert (util.config_bool_value(" 1 "))
        assert (util.config_bool_value(" YeS "))
        assert not util.config_bool_value(" FalsE ")
        assert not util.config_bool_value(" 0 ")
        assert not util.config_bool_value(" No ")

        assert util.config_bool_value(True)
        assert not util.config_bool_value(None)
        assert not util.config_bool_value(False)