Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)