Skip to content

Commit

Permalink
test Data no arg init
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Jan 12, 2023
1 parent 59a6e3d commit 8e343bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cf/test/test_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ def test_Data__init__basic(self):
"""Test basic `__init__` cases for Data."""
# Most __init__ parameters are covered by the various other
# tests, so this is mainly to check trivial cases.
cf.Data(0, "s")
cf.Data(array=np.arange(5))
cf.Data(source=self.filename)

d = cf.Data()
with self.assertRaises(ValueError):
d.ndim

with self.assertRaises(ValueError):
d.get_filenames()

def test_Data__init__no_args(self):
"""Test `__init__` with no arg."""
# Most __init__ parameters are covered by the various other
# tests, so this is mainly to check trivial cases.
cf.Data()
cf.Data(0, "s")
cf.Data(array=np.arange(5))
Expand Down

0 comments on commit 8e343bb

Please sign in to comment.