blob: 0e7a2d4516556204341d599b978110e812ff55df [file] [log] [blame]
Scott Bakera33ccb02018-01-26 13:03:28 -08001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17import unittest
18from xosgenx.jinja2_extensions.base import *
19from helpers import FakeArgs, XProtoTestHelpers
20
21class Jinja2BaseTests(unittest.TestCase):
22 def test_xproto_is_true(self):
23 self.assertTrue(xproto_is_true(True))
24 self.assertTrue(xproto_is_true("True"))
25 self.assertTrue(xproto_is_true('"True"'))
26 self.assertFalse(xproto_is_true(False))
27 self.assertFalse(xproto_is_true("False"))
28 self.assertFalse(xproto_is_true('"False"'))
29 self.assertFalse(xproto_is_true(None))
30 self.assertFalse(xproto_is_true("something else"))
31
32if __name__ == '__main__':
33 unittest.main()
34
35