示例#1
0
    def test_inspect(self):
        rd = RequestDataset(self.uri, self.variable)
        with self.print_scope() as ps:
            rd.inspect()
        self.assertTrue(len(ps.storage) >= 1)

        uri = ShpCabinet().get_shp_path('state_boundaries')
        rd = RequestDataset(uri=uri, driver='vector')
        with self.print_scope() as ps:
            rd.inspect()
        self.assertTrue(len(ps.storage) >= 1)

        # test with a request dataset having no dimensioned variables
        path = self.get_temporary_file_path('bad.nc')
        with self.nc_scope(path, 'w') as ds:
            ds.createDimension('foo')
            var = ds.createVariable('foovar', int, dimensions=('foo',))
            var.a_name = 'a name'
        rd = RequestDataset(uri=path)
        with self.print_scope() as ps:
            rd.inspect()
        self.assertTrue(len(ps.storage) >= 1)
示例#2
0
 def test_inspect_method(self):
     rd = RequestDataset(self.uri, self.variable)
     rd.inspect()