Exemple #1
0
def test_empty_jsoc_response():
    Jresp = JSOCResponse()
    assert Jresp.table is None
    assert Jresp.query_args is None
    assert Jresp.requests is None
    assert str(Jresp) == 'None'
    assert repr(Jresp) == 'None'
    assert len(Jresp) == 0
Exemple #2
0
def jsoc_response_double():
    resp = JSOCResponse([{
        'T_REC': '2011/01/01T00:00',
        'INSTRUME': 'AIA'
    }, {
        'T_REC': '2011/01/02T00:00',
        'INSTRUME': 'AIA'
    }])

    resp.query_args = [{
        'start_time':
        astropy.time.Time("2020-01-01T01:00:36.000"),
        'end_time':
        astropy.time.Time("2020-01-01T01:00:38.000"),
        'series':
        'hmi.M_45s',
        'notify':
        '*****@*****.**'
    }]

    return resp
Exemple #3
0
def test_jsocresponse_single():
    j1 = JSOCResponse(table=None)
    assert len(j1) == 0
    j1.append(astropy.table.Table(data=[[1, 2, 3, 4]]))
    assert all(j1.table == astropy.table.Table(data=[[1, 2, 3, 4]]))
    assert len(j1) == 4
Exemple #4
0
def test_jsocresponse_single():
    j1 = JSOCResponse(table=None)
    assert len(j1) == 0
    j1.append(astropy.table.Table(data=[[1,2,3,4]]))
    assert all(j1.table == astropy.table.Table(data=[[1,2,3,4]]))
    assert len(j1) == 4
Exemple #5
0
def test_jsocresponse_double():
    j1 = JSOCResponse(table=astropy.table.Table(data=[[1,2,3,4]]))
    j1.append(astropy.table.Table(data=[[1,2,3,4]]))
    assert isinstance(j1, JSOCResponse)
    assert all(j1.table == astropy.table.vstack([astropy.table.Table(data=[[1,2,3,4]]),
                                                 astropy.table.Table(data=[[1,2,3,4]])]))
Exemple #6
0
def test_jsocresponse_double():
    j1 = JSOCResponse(table=astropy.table.Table(data=[[1, 2, 3, 4]]))
    j1.append(astropy.table.Table(data=[[1, 2, 3, 4]]))
    assert isinstance(j1, JSOCResponse)
    assert all(j1.table == astropy.table.vstack([astropy.table.Table(
        data=[[1, 2, 3, 4]]), astropy.table.Table(data=[[1, 2, 3, 4]])]))
Exemple #7
0
def test_empty_jsoc_response():
    Jresp = JSOCResponse()
    assert len(Jresp) == 0
    assert Jresp.query_args is None
    assert Jresp.requests is None
    assert len(Jresp) == 0
Exemple #8
0
def test_jsocresponse_single():
    j1 = JSOCResponse(data=[[1, 2, 3, 4]])
    assert all(j1 == astropy.table.Table(data=[[1, 2, 3, 4]]))
    assert len(j1) == 4