def test_parse_search_term_class_validate_truth_good_values():
    p = ParseSearchTerm('abc')
    p.not_common_words.append('abc')
    p.strong_occurrences += 1
    p.add_occurrence('abc', 1)
    p.validate_truth()
    assert p.truth_ratio == 1
def test_parse_search_term_class_gen_new_truth_good_value_middle():
    p = ParseSearchTerm('a b c')
    p.not_common_words.append('b')
    p.gen_new_truth()
    assert p.new_statement_that_can_be_true == 'a c'
def test_parse_search_term_class_add_occurrence_wrong_key():
    p = ParseSearchTerm('a b')
    with pytest.raises(InputError):
        p.add_occurrence('c', 2)
def test_parse_search_term_class_add_occurrence_float_value():
    p = ParseSearchTerm('a b')
    with pytest.raises(InputError):
        p.add_occurrence('a', 4.2)
def test_parse_search_term_class_add_occurrence_good_value():
    p = ParseSearchTerm('a b')
    p.add_occurrence('a', 1)
    assert p.split_search_term['a'] == 1
def test_parse_search_term_class_init_spaces_value():
    with pytest.raises(InputError):
        ParseSearchTerm('   ')
def test_parse_search_term_class_init_good_value():
    assert type(ParseSearchTerm('search_term')) == ParseSearchTerm
def test_search_result_interpreter_class_init_good_vales():
    p = ParseSearchTerm('abc')
    s = SearchResultInterpreter(p)
    assert type(s) == SearchResultInterpreter
def test_search_result_class_visit_link_and_search_wrong_link():
    p = ParseSearchTerm('abc')
    s = SearchResult(p, 'abc', 'abc')
    with pytest.raises(ConnectError):
        s.visit_link_and_search()
def test_search_result_class_init_good_vales():
    p = ParseSearchTerm('abc')
    s = SearchResult(p, 'abc', 'abc')
    assert type(s) == SearchResult