Skip to content

Commit

Permalink
Remove unused FakeDataset in ABI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Jan 8, 2020
1 parent 27a1a8c commit e9c1a53
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
30 changes: 0 additions & 30 deletions satpy/tests/reader_tests/test_abi_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,6 @@
import mock


class FakeDataset(object):
"""Act like an xarray Dataset object for testing."""

def __init__(self, info, attrs, dims=None):
"""Set properties to mimic a Dataset object."""
for var_name, var_data in list(info.items()):
if isinstance(var_data, np.ndarray):
info[var_name] = xr.DataArray(var_data)
self.info = info
self.attrs = attrs
self.coords = {}
self.dims = dims or tuple()

def __getitem__(self, key):
"""Get the info for the fake data."""
return self.info[key]

def __contains__(self, key):
"""Check if key is in the fake data."""
return key in self.info

def rename(self, *args, **kwargs):
"""Allow for dimension renaming."""
return self

def close(self):
"""Pretend to close."""
return


class Test_NC_ABI_L1B_Base(unittest.TestCase):
"""Common setup for NC_ABI_L1B tests."""

Expand Down
29 changes: 0 additions & 29 deletions satpy/tests/reader_tests/test_glm_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,6 @@
import mock


class FakeDataset(object):
"""Act like an xarray Dataset object for testing."""

def __init__(self, info, attrs, dims=None):
"""Set properties to mimic a Dataset object."""
for var_name, var_data in list(info.items()):
if isinstance(var_data, np.ndarray):
info[var_name] = xr.DataArray(var_data)
self.info = info
self.attrs = attrs
self.dims = dims or tuple()

def __getitem__(self, key):
"""Get the info for the fake data."""
return self.info[key]

def __contains__(self, key):
"""Check if key is in the fake data."""
return key in self.info

def rename(self, *args, **kwargs):
"""Allow for dimension renaming."""
return self

def close(self):
"""Pretend to close."""
return


def setup_fake_dataset():
"""Create a fake dataset to avoid opening a file."""
# flash_extent_density
Expand Down

0 comments on commit e9c1a53

Please sign in to comment.