Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Test for TRACEMap #2504

Merged
merged 7 commits into from Mar 8, 2018
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions sunpy/map/sources/tests/test_trace_source.py
@@ -0,0 +1,35 @@
import os
import glob
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to remove the import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry , My bad .


import pytest

from sunpy.map.sources.trace import TRACEMap
from sunpy.map import Map
import sunpy.data.test

path = sunpy.data.test.rootdir
fitspath = os.path.join(path, "tsi20010130_025823_a2.fits")

@pytest.fixture(scope="module")
def createTRACE():
"""Creates a TRACEMap from a FITS file."""
return Map(fitspath)

# TRACE Tests
def test_fitstoTRACE(createTRACE):
"""Tests the creation of TRACEMap using FITS."""
assert isinstance(createTRACE, TRACEMap)

def test_is_datasource_for(createTRACE):
"""Test the is_datasource_for method of TRACEMap.
Note that header data to be provided as an argument
can be a MetaDict object."""
assert createTRACE.is_datasource_for(createTRACE.data, createTRACE.meta)

def test_measurement(createTRACE):
"""Tests the measurement property of the TRACEMap object."""
assert int(createTRACE.measurement) == 171

def test_observatory(createTRACE):
"""Tests the observatory property of the TRACEMap object."""
assert createTRACE.observatory == "TRACE"