def test_tempest(self, mocker):
        """Validate when configured with tempest as tool"""

        # Mock
        zz = mocker.MagicMock()
        zz.test_runner = 'tempest'
        zz.utility_facade = UtilityFacade(zz)

        # Setup
        classname = 'tests.test_default'

        # Test
        mhf = ModuleHierarchyFacade(zz)
        assert ['tests.test_default'] == mhf.get_module_hierarchy(classname)
    def test_bad_value(self, mocker):
        """Validate that if a bad value gets in we default to asc"""
        # Mock
        zz = mocker.MagicMock()
        zz.ci_environment = 'oops'
        zz.utility_facade = UtilityFacade(zz)
        zz.testsuite_props = ASC_TESTSUITE_PROPS

        # Setup
        classname = 'tests.test_default'

        # Test
        mhf = ModuleHierarchyFacade(zz)
        mh = mhf.get_module_hierarchy(classname)
        assert mh == ['foo', 'bar', 'baz', 'barf', 'test_default']
    def test_asc(self, mocker):
        """Validate when configured with asc as ci-environment"""

        # Mock
        zz = mocker.MagicMock()
        zz.ci_environment = 'asc'
        zz.utility_facade = UtilityFacade(zz)
        zz.testsuite_props = ASC_TESTSUITE_PROPS

        # Setup
        classname = 'tests.test_default'

        # Test
        mhf = ModuleHierarchyFacade(zz)
        mh = mhf.get_module_hierarchy(classname)
        assert mh == ['foo', 'bar', 'baz', 'barf', 'test_default']
    def test_mk8s_branch_periodic(self, mocker):
        """Validate when configured with mk8s as ci-environment"""

        # Mock
        zz = mocker.MagicMock()
        zz.ci_environment = 'mk8s'
        zz.utility_facade = UtilityFacade(zz)
        zz.testsuite_props = {
            'BRANCH_NAME': 'master',
        }

        # Setup
        classname = 'tests.test_default'

        # Test
        mhf = ModuleHierarchyFacade(zz)
        assert mhf.get_module_hierarchy(classname) == ['tests.test_default']