Scott Baker | a33ccb0 | 2018-01-26 13:03:28 -0800 | [diff] [blame] | 1 | |
| 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 | |
| 17 | import unittest |
| 18 | from xosgenx.jinja2_extensions.base import * |
| 19 | from helpers import FakeArgs, XProtoTestHelpers |
| 20 | |
| 21 | class 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 | |
| 32 | if __name__ == '__main__': |
| 33 | unittest.main() |
| 34 | |
| 35 | |