Esempio n. 1
0
 def test_clearcache(self):
     with tempfile.TemporaryDirectory() as testcachedir:
         with argopy.set_options(cachedir=testcachedir):
             loader = ArgoIndexFetcher(src=self.src, cache=True).float(self.requests['float'][0])
             loader.to_xarray()
             loader.clear_cache()
             with pytest.raises(CacheFileNotFound):
                 loader.fetcher.cachepath
 def test_clearcache(self):
     with tempfile.TemporaryDirectory() as testcachedir:
         with argopy.set_options(cachedir=testcachedir,
                                 local_ftp=self.local_ftp):
             loader = ArgoIndexFetcher(
                 src=self.src,
                 cache=True).profile(*self.requests['profile'][0])
             loader.to_dataframe(
             )  # 1st call to load from source and save in memory
             loader.to_dataframe(
             )  # 2nd call to load from memory and save in cache
             loader.clear_cache()
             with pytest.raises(CacheFileNotFound):
                 loader.fetcher.cachepath