############################################################################## # Copyright (c) 2017 Tim Rozet (Red Hat) # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import unittest from apex.builders import undercloud_builder as uc_builder from mock import patch class TestUndercloudBuilder(unittest.TestCase): @classmethod def setup_class(cls): """This method is run once for each class before any tests are run""" @classmethod def teardown_class(cls): """This method is run once for each class _after_ all tests are run""" def setup(self): """This method is run once before _each_ test method is executed""" def teardown(self): """This method is run once after _each_ test method is executed""" @patch('apex.virtual.utils.virt_customize') def test_add_upstream_pkgs(self, mock_customize): uc_builder.add_upstream_packages('dummy.qcow2') assert mock_customize.called