Пример #1
0
def test_get_tag_counts_normalize(scratch_tag_year_counts, scratch_year_counts):
    counts = utils.get_tag_counts('spm', normalize=True)
    expected = [
        (2007, 25 / 100),
        (2008, 30 / 150),
        (2009, 35 / 200),
    ]
    for label, count in counts:
        assert type(label) == int
        assert type(count) == float
    assert counts == expected
Пример #2
0
def test_get_tag_counts(scratch_tag_year_counts):
    counts = utils.get_tag_counts('spm', normalize=False)
    expected = [
        (2007, 25),
        (2008, 30),
        (2009, 35),
    ]
    for label, count in counts:
        assert type(label) == int
        assert type(count) == int
    assert counts == expected
Пример #3
0
def test_get_tag_counts(scratch_tag_year_counts):
    counts = utils.get_tag_counts('spm', normalize=False)
    expected = [
        (2007, 25),
        (2008, 30),
        (2009, 35),
    ]
    for label, count in counts:
        assert type(label) == int
        assert type(count) == int
    assert counts == expected
Пример #4
0
def test_get_tag_counts_normalize(scratch_tag_year_counts,
                                  scratch_year_counts):
    counts = utils.get_tag_counts('spm', normalize=True)
    expected = [
        (2007, 25 / 100),
        (2008, 30 / 150),
        (2009, 35 / 200),
    ]
    for label, count in counts:
        assert type(label) == int
        assert type(count) == float
    assert counts == expected