示例#1
0
    def test_section_scalar_ancillaries(self):
        # There *is* no section for this.  But there probably ought to be.
        cube = Cube(np.zeros((2, 3)), long_name="name", units=1)
        cube.add_ancillary_variable(AncillaryVariable([0], long_name="av"))

        rep = cube_replines(cube)
        expected = [
            "name / (1)                          (-- : 2; -- : 3)",
            "    Ancillary variables:",
            "        av                              -       -",
        ]
        self.assertEqual(rep, expected)
示例#2
0
    def test_section_vector_ancils(self):
        cube = Cube(np.zeros((2, 3)), long_name="name", units=1)
        cube.add_ancillary_variable(AncillaryVariable([0, 1], long_name="av1"),
                                    0)

        rep = cube_replines(cube)
        expected = [
            "name / (1)                          (-- : 2; -- : 3)",
            "    Ancillary variables:",
            "        av1                             x       -",
        ]
        self.assertEqual(rep, expected)