import pytest

from api.models.utils import rankings


@pytest.fixture
def test_data():
    return [1, 11, 101]


def test_rankings(test_data):
    """Tests if ranking works
    e.g. 1 returns 1st
         11 returns 11th
         101 return 101st
    """
    assert rankings(test_data[0]) == "1st"
    assert rankings(test_data[1]) == "11th"
    assert rankings(test_data[2]) == "101st"

[((17, 11, 17, 33), 'api.models.utils.rankings', 'rankings', ({(17, 20, 17, 32): 'test_data[0]'}, {}), '(test_data[0])', False, 'from api.models.utils import rankings\n'), ((18, 11, 18, 33), 'api.models.utils.rankings', 'rankings', ({(18, 20, 18, 32): 'test_data[1]'}, {}), '(test_data[1])', False, 'from api.models.utils import rankings\n'), ((19, 11, 19, 33), 'api.models.utils.rankings', 'rankings', ({(19, 20, 19, 32): 'test_data[2]'}, {}), '(test_data[2])', False, 'from api.models.utils import rankings\n')]