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"

[((267, 289), 'api.models.utils.rankings', 'rankings', (['test_data[0]'], {}), '(test_data[0])\n', (275, 289), False, 'from api.models.utils import rankings\n'), ((310, 332), 'api.models.utils.rankings', 'rankings', (['test_data[1]'], {}), '(test_data[1])\n', (318, 332), False, 'from api.models.utils import rankings\n'), ((354, 376), 'api.models.utils.rankings', 'rankings', (['test_data[2]'], {}), '(test_data[2])\n', (362, 376), False, 'from api.models.utils import rankings\n')]