Bumps OVS version to 2.8 for OVN
[apex.git] / tests / test_apex_common_utils.py
1 ##############################################################################
2 # Copyright (c) 2016 Dan Radez (Red Hat)
3 #
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 ##############################################################################
9
10 import nose.tools
11
12 from apex.common import utils
13
14
15 class TestCommonUtils(object):
16     @classmethod
17     def setup_class(klass):
18         """This method is run once for each class before any tests are run"""
19
20     @classmethod
21     def teardown_class(klass):
22         """This method is run once for each class _after_ all tests are run"""
23
24     def setUp(self):
25         """This method is run once before _each_ test method is executed"""
26
27     def teardown(self):
28         """This method is run once after _each_ test method is executed"""
29
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)
35
36     def test_parse_yaml(self):
37         nose.tools.assert_is_instance(
38             utils.parse_yaml('../config/network/network_settings.yaml'),
39             dict)