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 ##############################################################################
10 from apex.network_settings import NetworkSettings
12 from nose.tools import assert_equal
13 from nose.tools import assert_is_instance
16 class TestNetworkSettings(object):
18 def setup_class(klass):
19 """This method is run once for each class before any tests are run"""
22 def teardown_class(klass):
23 """This method is run once for each class _after_ all tests are run"""
26 """This method is run once before _each_ test method is executed"""
29 """This method is run once after _each_ test method is executed"""
32 ns = NetworkSettings('../config/network/network_settings.yaml', True)
34 def test_dump_bash(self):
35 ns = NetworkSettings('../config/network/network_settings.yaml', True)
36 assert_equal(ns.dump_bash(), None)
37 assert_equal(ns.dump_bash(path='/dev/null'), None)
39 def test_get_network_settings(self):
40 ns = NetworkSettings('../config/network/network_settings.yaml', True)
41 assert_is_instance(ns.get_network_settings(), dict)
43 def test_get_enabled_networks(self):
44 ns = NetworkSettings('../config/network/network_settings.yaml', True)
45 assert_is_instance(ns.get_enabled_networks(), list)