Skip to content

Commit

Permalink
Updated tests to test new string messages. 100%!
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Jun 23, 2015
1 parent 3bf5fc0 commit 6681875
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions mpop/projectable.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def __str__(self):
if "sensor" in self.info:
res[0] = str(self.info["sensor"]) + "/" + res[0]


for key in sorted(self.info.keys()):
if key == "wavelength_range":
res.append("{0}: {1} μm".format(key, self.info[key]))
Expand All @@ -176,13 +175,6 @@ def __str__(self):
else:
res.append("{0}: {1}".format(key, self.info[key]))

# if "wavelength_range" in self.info:
# res.append("{0} μm".format(self.info["wavelength_range"]))
# if "resolution" in self.info:
# res.append("{0} m".format(self.info["resolution"]))
# for key in self.info:
# if key not in ["sensor", "wavelength_range", "resolution", "name"]:
# res.append(str(self.info[key]))
if self.data is not None:
try:
res.append("shape: {0}".format(self.data.shape))
Expand Down
6 changes: 6 additions & 0 deletions mpop/tests/test_projectable.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,17 @@ def test_to_image_1D(self):
self.assertRaises(ValueError, p.to_image)

def test_str(self):
# FIXME: Is there a better way to fake the area?
class FakeArea(object):
name = "fake_area"

# Normal situation
p = projectable.Projectable(np.arange(25),
sensor="fake_sensor",
wavelength_range=500,
resolution=250,
fake_attr="fakeattr",
area=FakeArea(),
)
p_str = str(p)

Expand Down

0 comments on commit 6681875

Please sign in to comment.