Ejemplo n.º 1
0
def test_allvars(mock_get_and_remove):
    """Test fixes for all vars."""
    fix = AllVars(None)
    fix.fix_metadata(CUBES)
    assert mock_get_and_remove.call_count == 3
    assert mock_get_and_remove.call_args_list == [
        mock.call(CUBES, 'Start time for average period'),
        mock.call(CUBES, 'End time for average period'),
        mock.call(CUBES, 'Length of average period'),
    ]
Ejemplo n.º 2
0
 def test_get(self):
     """Test fix get"""
     self.assertListEqual(
         Fix.get_fixes('CMIP5', 'GFDL-ESM2G', 'day', 'usi'),
         [Usi(self.vardef), AllVars(self.vardef)])
Ejemplo n.º 3
0
 def test_get(self):
     """Test fix get"""
     self.assertListEqual(
         Fix.get_fixes('CMIP5', 'GFDL-ESM2G', 'Amon', 'co2'),
         [Co2(None), AllVars(None)])
Ejemplo n.º 4
0
 def test_get(self):
     """Test fix get"""
     self.assertListEqual(
         Fix.get_fixes('CMIP5', 'GFDL-ESM2G', 'fx', 'areacello'),
         [Areacello(self.vardef),
          AllVars(self.vardef)])
Ejemplo n.º 5
0
 def test_get(self):
     """Test fix get"""
     self.assertListEqual(Fix.get_fixes('CMIP5', 'GFDL-ESM2G', 'usi'),
                          [AllVars(), Usi()])