1 ##############################################################################
2 # Copyright (c) 2018 Tim Rozet (trozet@redhat.com) (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 ##############################################################################
13 from apex.deployment.tripleo import ApexDeployment
14 from apex.settings.deploy_settings import DeploySettings
15 from apex.tests.constants import TEST_DUMMY_CONFIG
18 class TestApexDeployment(unittest.TestCase):
21 """This method is run once for each class before any tests are run"""
24 def teardown_class(cls):
25 """This method is run once for each class _after_ all tests are run"""
28 """This method is run once before _each_ test method is executed"""
31 """This method is run once after _each_ test method is executed"""
33 def test_determine_patches(self):
35 ds_file = os.path.join(TEST_DUMMY_CONFIG, 'dummy-deploy-settings.yaml')
36 ds = DeploySettings(ds_file)
37 patches_file = os.path.join(TEST_DUMMY_CONFIG, 'common-patches.yaml')
38 d = ApexDeployment(deploy_settings=ds, patch_file=patches_file,
40 patches = d.determine_patches()
43 [{'change-id': 'I2e0a40d7902f592e4b7bd727f57048111e0bea36',
44 'project': 'openstack/tripleo-common'}],
46 [{'change-id': 'Ie988ba6a2d444a614e97c0edf5fce24b23970310',
47 'project': 'openstack/puppet-tripleo'}]
49 self.assertDictEqual(patches, test_patches)