Esempio n. 1
0
    def test_check_num_elements_right_nmaps(self):
        """With the right number of maps between two components, check_num_elements should pass"""
        component_grids = _ComponentGrids(self._GRID_LONGNAME)
        gridinfo = {"GLC2ROF_RMAPNAME": "map1:map2:map3:map4:map5:map6"}

        # The test passes as long as the following call doesn't generate any errors
        component_grids.check_num_elements(gridinfo)
Esempio n. 2
0
    def test_check_num_elements_right_ndomains(self):
        """With the right number of domains for a component, check_num_elements should pass"""
        component_grids = _ComponentGrids(self._GRID_LONGNAME)
        gridinfo = {"GLC_DOMAIN_MESH": "foo:bar:baz"}

        # The test passes as long as the following call doesn't generate any errors
        component_grids.check_num_elements(gridinfo)
Esempio n. 3
0
    def test_check_num_elements_wrong_nmaps(self):
        """With the wrong number of maps between two components, check_num_elements should fail"""
        component_grids = _ComponentGrids(self._GRID_LONGNAME)
        # In the following, there should be 6 elements, but we only specify 5
        gridinfo = {'GLC2ROF_RMAPNAME': 'map1:map2:map3:map4:map5'}

        self.assertRaisesRegex(
            CIMEError, "Unexpected number of colon-delimited elements",
            component_grids.check_num_elements, gridinfo)
Esempio n. 4
0
    def test_check_num_elements_wrong_ndomains(self):
        """With the wrong number of domains for a component, check_num_elements should fail"""
        component_grids = _ComponentGrids(self._GRID_LONGNAME)
        # In the following, there should be 3 elements, but we only specify 2
        gridinfo = {'GLC_DOMAIN_MESH': 'foo:bar'}

        self.assertRaisesRegex(
            CIMEError, "Unexpected number of colon-delimited elements",
            component_grids.check_num_elements, gridinfo)