1 ##############################################################################
2 # Copyright (c) 2016 Tim Rozet (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 ##############################################################################
14 from apex import clean_nodes
15 from mock import patch
16 from nose import tools
19 class TestClean(object):
21 def setup_class(klass):
22 """This method is run once for each class before any tests are run"""
25 def teardown_class(klass):
26 """This method is run once for each class _after_ all tests are run"""
29 """This method is run once before _each_ test method is executed"""
32 """This method is run once after _each_ test method is executed"""
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')
40 tools.assert_equal(mock_method.call_count, 5)
41 tools.assert_equal(mock_method2.call_count, 5)