Beispiel #1
0
def test_hst_filename():
    """Verify basename of a standard hst filename."""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name)
    short_compare = ntpath.basename(shortname)
    assert_equal(hst_name, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, None)
Beispiel #2
0
def test_hst_filename():
    """Verify basename of a standard hst filename."""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name)
    short_compare = ntpath.basename(shortname)
    assert_equal(hst_name, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, None)
Beispiel #3
0
def test_hst_filename():
    """Verify split of a standard hst filename."""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name)
    short_compare = shortname.split("/")[-1]
    assert_equal(hst_name, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, None)
Beispiel #4
0
def test_extname():
    """Verify that specifying an extname gets recorded correctly."""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name,
                                                      extname='sci')
    short_compare = ntpath.basename(shortname)
    assert_equal(hst_name, short_compare)
    assert_equal(extname, 'sci')
    assert_equal(extver, None)
Beispiel #5
0
def test_name_ver_filename():
    """Verify basename of a filename given name and ver."""

    hst_name_ver = "hstimagex_cal.fits[1]"
    rootname = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name_ver)
    short_compare = ntpath.basename(shortname)
    assert_equal(rootname, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, 1)
Beispiel #6
0
def test_extname():
    """Verify that specifying an extname gets recorded correctly."""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name,
                                                      extname='sci')
    short_compare = ntpath.basename(shortname)
    assert_equal(hst_name, short_compare)
    assert_equal(extname, 'sci')
    assert_equal(extver, None)
Beispiel #7
0
def test_name_ver_filename():
    """Verify basename of a filename given name and ver."""

    hst_name_ver = "hstimagex_cal.fits[1]"
    rootname = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name_ver)
    short_compare = ntpath.basename(shortname)
    assert_equal(rootname, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, 1)
Beispiel #8
0
def test_name_ver_filename():
    """Verify split of a filename given name and ver."""

    hst_name_ver = "hstimagex_cal.fits[1]"
    rootname = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name_ver)
    short_compare = shortname.split("/")[-1]
    assert_equal(rootname, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, 1)
Beispiel #9
0
def test_name_ver():
    """Verify that specifying both name and ver gets recorded correctly."""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name,
                                                      extname='sci',
                                                      extver=1)
    short_compare = shortname.split("/")[-1]
    assert_equal(hst_name, short_compare)
    assert_equal(extname, 'sci')
    assert_equal(extver, 1)
Beispiel #10
0
def test_extver():
    """Verify that specifying an extver gets recorded correctly.

    extver is the extension number explicitly"""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name,
                                                      extver=1)
    short_compare = ntpath.basename(shortname)
    assert_equal(hst_name, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, 1)
Beispiel #11
0
def test_extver():
    """Verify that specifying an extver gets recorded correctly.

    extver is the extension number explicitly"""

    hst_name = "hstimagex_cal.fits"
    shortname, extname, extver = util.verify_filename(filename=hst_name,
                                                      extver=1)
    short_compare = ntpath.basename(shortname)
    assert_equal(hst_name, short_compare)
    assert_equal(extname, None)
    assert_equal(extver, 1)