Skip to content
Snippets Groups Projects
Commit cf588fee authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Remove MagWebFactory

parent 684d9904
No related branches found
No related tags found
No related merge requests found
"""
Load IAGA2002 format files from http://magweb.cr.usgs.gov
"""
from IAGA2002Factory import IAGA2002Factory, IAGA_FILE_PATTERN
# url pattern for magweb.cr.usgs.gov
MAGWEB_URL_TEMPLATE = 'http://magweb.cr.usgs.gov/data/magnetometer/' + \
'%(OBS)s/%(interval)s%(type)s/' + IAGA_FILE_PATTERN
class MagWebFactory(IAGA2002Factory):
"""IAGA2002Factory configured for magweb.cr.usgs.gov"""
def __init__(self, observatory=None, channels=None, type=None,
interval=None):
"""Create a IAGA2002Factory configured to use magweb.cr.usgs.gov"""
IAGA2002Factory.__init__(self, MAGWEB_URL_TEMPLATE,
observatory=observatory, channels=channels, type=type,
interval=interval)
MagWebFactory.MAGWEB_URL_TEMPLATE = MAGWEB_URL_TEMPLATE
......@@ -8,13 +8,11 @@ from IAGA2002Factory import IAGA2002Factory
from StreamIAGA2002Factory import StreamIAGA2002Factory
from IAGA2002Parser import IAGA2002Parser
from IAGA2002Writer import IAGA2002Writer
from MagWebFactory import MagWebFactory
__all__ = [
'IAGA2002Factory',
'StreamIAGA2002Factory',
'IAGA2002Parser',
'IAGA2002Writer',
'MagWebFactory'
'IAGA2002Writer'
]
"""Tests for MagWebFactory."""
from geomagio.iaga2002 import MagWebFactory
from nose.tools import assert_equals
def test_init():
"""iaga2002_test.MagWebFactory_test.test_init()
Verify MagWebFactory calls parent constructor with MAGWEB_URL_TEMPLATE.
"""
factory = MagWebFactory()
assert_equals(factory.urlTemplate, MagWebFactory.MAGWEB_URL_TEMPLATE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment