1 ##############################################################################
2 # Copyright (c) 2016 Dan Radez (Red Hat)
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 from apex.common import utils
15 class TestCommonUtils(object):
17 def setup_class(klass):
18 """This method is run once for each class before any tests are run"""
21 def teardown_class(klass):
22 """This method is run once for each class _after_ all tests are run"""
25 """This method is run once before _each_ test method is executed"""
28 """This method is run once after _each_ test method is executed"""
30 def test_str2bool(self):
31 nose.tools.assert_equal(utils.str2bool(True), True)
32 nose.tools.assert_equal(utils.str2bool(False), False)
33 nose.tools.assert_equal(utils.str2bool("True"), True)
34 nose.tools.assert_equal(utils.str2bool("YES"), True)
36 def test_parse_yaml(self):
37 nose.tools.assert_is_instance(
38 utils.parse_yaml('../config/network/network_settings.yaml'),