Exemplo n.º 1
0
def test_run_batch_bad_date_order():
    """
    Check that run_batch raises error when end date comes before start date
    """
    root = '/'
    start = '2015-01-01T00:00:00'
    end = '2015-01-02T00:00:00'
    with pytest.raises(ValueError) as bad_order:
        getter.run_batch(root, end, start)

    assert bad_order.value.message == 'Start date must come before end date'
Exemplo n.º 2
0
def test_run_batch_bad_date2():
    """
    Check that run_batch raises error for an invalid end date argument
    """
    date = '2015-20-01T00:00:00'
    root = '/'
    start = '2015-01-01T00:00:00'
    with pytest.raises(ValueError) as bad_date:
        getter.run_batch(root, start, date)

    assert bad_date.value.message == 'Invalid/missing dates'
Exemplo n.º 3
0
def test_run_batch_bad_root():
    """
    Check that run_batch raises error for non-existent root path argument
    """
    root = 'blahasdfjadksx'
    start = '2015-01-01T00:00:00'
    end = '2015-01-02T00:00:00'
    with pytest.raises(ValueError) as bad_root:
        getter.run_batch(root, start, end)

    assert bad_root.value.message == 'Root directory not found'
Exemplo n.º 4
0
def test_run_batch_bad_date2():
    """
    Check that run_batch raises error for an invalid end date argument
    """
    date = '2015-20-01T00:00:00'
    root = '/'
    start = '2015-01-01T00:00:00'
    with pytest.raises(ValueError) as bad_date:
        getter.run_batch(root, start, date)

    assert bad_date.value.message == 'Invalid/missing dates'
Exemplo n.º 5
0
def test_run_batch_bad_root():
    """
    Check that run_batch raises error for non-existent root path argument
    """
    root = 'blahasdfjadksx'
    start = '2015-01-01T00:00:00'
    end = '2015-01-02T00:00:00'
    with pytest.raises(ValueError) as bad_root:
        getter.run_batch(root, start, end)

    assert bad_root.value.message == 'Root directory not found'
Exemplo n.º 6
0
def test_run_batch_bad_date_order():
    """
    Check that run_batch raises error when end date comes before start date
    """
    root = '/'
    start = '2015-01-01T00:00:00'
    end = '2015-01-02T00:00:00'
    with pytest.raises(ValueError) as bad_order:
        getter.run_batch(root, end, start)

    assert bad_order.value.message == 'Start date must come before end date'