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))
Exemple #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))
Exemple #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))