forked from pydata/xarray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_tutorial.py
More file actions
29 lines (22 loc) · 844 Bytes
/
Copy pathtest_tutorial.py
File metadata and controls
29 lines (22 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import pytest
from xarray import tutorial, DataArray
from xarray.core.pycompat import suppress
from . import TestCase, network
@network
class TestLoadDataset(TestCase):
def setUp(self):
self.testfile = 'tiny'
self.testfilepath = os.path.expanduser(os.sep.join(
('~', '.xarray_tutorial_data', self.testfile)))
with suppress(OSError):
os.remove('{}.nc'.format(self.testfilepath))
with suppress(OSError):
os.remove('{}.md5'.format(self.testfilepath))
def test_download_from_github(self):
ds = tutorial.load_dataset(self.testfile)
tiny = DataArray(range(5), name='tiny').to_dataset()
self.assertDatasetIdentical(ds, tiny)