Ejemplo n.º 1
0
def test_to_chunks_exceptions():
    df = DataFrame(data={'data': [1, 2, 3]})
    c = DateChunker()
    with pytest.raises(Exception) as e:
        six.next(c.to_chunks(None, None))
    assert ('Chunk size' in str(e))

    with pytest.raises(Exception) as e:
        six.next(c.to_chunks(df, 'D'))
    assert ('datetime indexed' in str(e))
Ejemplo n.º 2
0
def test_to_chunks_exceptions():
    df = DataFrame(data={'data': [1, 2, 3]})
    c = DateChunker()

    with pytest.raises(Exception) as e:
        six.next(c.to_chunks(df, 'D'))
    assert ('datetime indexed' in str(e))

    df.columns = ['date']
    with pytest.raises(Exception) as e:
        six.next(c.to_chunks(df, 'ZSDFG'))
    assert ('Unknown freqstr' in str(e) or 'Invalid frequency' in str(e))
Ejemplo n.º 3
0
def test_to_chunks_exceptions():
    df = DataFrame(data={'data': [1, 2, 3]})
    c = DateChunker()

    with pytest.raises(Exception) as e:
        six.next(c.to_chunks(df, 'D'))
    assert('datetime indexed' in str(e))

    df.columns = ['date']
    with pytest.raises(Exception) as e:
        six.next(c.to_chunks(df, 'ZSDFG'))
    assert('Unknown freqstr' in str(e) or 'Invalid frequency' in str(e))