Bumps OVS version to 2.8 for OVN
[apex.git] / tests / test_apex_clean.py
1 ##############################################################################
2 # Copyright (c) 2016 Tim Rozet (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 mock
11 import pyipmi
12 import pyipmi.chassis
13
14 from apex import clean_nodes
15 from mock import patch
16 from nose import tools
17
18
19 class TestClean(object):
20     @classmethod
21     def setup_class(klass):
22         """This method is run once for each class before any tests are run"""
23
24     @classmethod
25     def teardown_class(klass):
26         """This method is run once for each class _after_ all tests are run"""
27
28     def setUp(self):
29         """This method is run once before _each_ test method is executed"""
30
31     def teardown(self):
32         """This method is run once after _each_ test method is executed"""
33
34     def test_clean(self):
35         with mock.patch.object(pyipmi.Session, 'establish') as mock_method:
36             with patch.object(pyipmi.chassis.Chassis,
37                               'chassis_control_power_down') as mock_method2:
38                 clean_nodes('config/inventory.yaml')
39
40         tools.assert_equal(mock_method.call_count, 5)
41         tools.assert_equal(mock_method2.call_count, 5)