def test_filter_animals():
    date, time, species, count = animals.read_animals('animals.txt')
    kind = 'Grizzly'
    d, t, s, c = animals.filter_animals(kind, date, time, species, count)

    assert d == ['2011-04-22']
    assert t == ['21:06']
    assert s == ['Grizzly']
    assert c == [36]

    kind = 'Elk'
    d, t, s, c = animals.filter_animals(kind, date, time, species, count)

    assert d == ['2011-04-23', '2011-04-23']
    assert t == ['14:12', '10:24']
    assert s == ['Elk', 'Elk']
    assert c == [25, 26]
示例#2
0
def test_filter_animals():
    d, t, s, c = animals.read_animals('animals.txt')
    date, time, species, count = animals.filter_animals(d, t, s, c, 'Grizzly')

    assert date == ['2011-04-22']
    assert time == ['21:06']
    assert species == ['Grizzly']
    assert count == [36]
示例#3
0
def test_filter_animals():
    date, time, animal, count = \
        animals.read_animals('animals.txt')

    species = 'Elk'
    date, time, animal, count = \
        animals.filter_animals(date, time, animal, count, species)

    assert count == [25, 26]
    assert animal == ['Elk', 'Elk']
示例#4
0
def test_filter_animals():
    date, time, animal, count = \
        animals.read_animals('animals.txt')

    species = 'Elk'
    date, time, animal, count = \
        animals.filter_animals(date, time, animal, count, species)

    assert count == [25, 26]
    assert animal == ['Elk', 'Elk']
示例#5
0
def test_filter_animals2():
    date, time, animal, count = \
        animals.read_animals('animals.txt')
    date, time, animal, count = \
        animals.filter_animals(date, time,
                               animal, count,
                               'Elk')
    assert date == ['2011-04-23', '2011-04-23']
    assert time == ['14:12', '10:24']
    assert animal == ['Elk', 'Elk']
    assert count == [25, 26]
示例#6
0
def test_filter_animals1():
    date, time, animal, count = \
        animals.read_animals('animals.txt')
    date, time, animal, count = \
        animals.filter_animals(date, time,
                               animal, count,
                               'Grizzly')
    assert date == ['2011-04-22']
    assert time == ['21:06']
    assert animal == ['Grizzly']
    assert count == [36]