tribler.test_unit.core.database.test_ranks

Classes

TestRanks

Tests for the ranking logic.

Module Contents

class tribler.test_unit.core.database.test_ranks.TestRanks

Bases: ipv8.test.base.TestBase

Tests for the ranking logic.

test_title_rank_exact_match() None

Test if an exact title match leads to a score of exactly 1.

test_title_rank_no_match() None

Test if input of different titles leads to a score less than 1.

test_freshness_rank_zero() None

Test if invalid or unknown freshness has the lowest rank.

test_freshness_rank_max() None

Test if maximum freshness has the highest rank.

test_freshness_rank_relative() None

Test if fresh torrents have a higher score than old torrents.

test_seeders_rank_zero() None

Test if a torrent without seeders scores a 0.

test_seeders_rank_many() None

Test if a torrent with many seeders scores more than a 0.

test_seeders_rank_relative() None

Test if a torrent with more seeders scores higher.

test_seeders_rank_leechers() None

Test if a torrent with more leechers scores higher.

test_torrent_rank_exact_match() None

Test if an exact title match leads to a score of exactly 0.81.

This is 90% (no seeders/leechers) of 90% (no freshness) of an exact match score of 1.

test_torrent_rank__no_freshness() None

Test if no freshness is worse than any freshness.

test_torrent_rank_freshness() None

Test if recent freshness is better than old freshness.

test_torrent_rank_position() None

Test if word matches are preferred close to the start.

test_torrent_rank_intermediate() None

Test if word matches are preferred with less words in between.

test_torrent_rank_mis_position_one() None

Test if word matches are preferred with mismatches further on in the item.

test_torrent_rank_mis_position_many() None

Test if word group matches are preferred with mismatches further on in the item.

test_torrent_rank_reorder() None

Test if wrong order of words in the title imposes a penalty to the rank.

test_torrent_rank_miss() None

Test if missed words in the title imposes a penalty to the rank.

test_find_word_first() None

Test if a matched first word gets popped from the queue.

test_find_word_skip_one() None

Test if the number of skipped words is returned correctly when skipping over one.

test_find_word_skip_many() None

Test if the number of skipped words is returned correctly when skipping over many.

test_find_word_not_found() None

Test if the False is returned when a word is not found.