def test_total_number_results_correct():

    dictionary = {
        'key1': 1,
        'key2': 'hello',
        'feed': {
            'opensearch_totalresults': u'13'
        }
    }

    obtained_result = al.total_number_results(dictionary)
    expected_result = 13

    assert_equal(obtained_result, expected_result,
                 "The obtained number is different from the expected one")
def test_total_number_results_no_totalresults():

    dictionary = {'key1': 1, 'key2': 'hello', 'feed': {'key3': True}}

    with assert_raises(NoArgumentError):
        al.total_number_results(dictionary)
def test_total_number_results_no_feed():

    dictionary = {'key1': 1, 'key2': 'hello'}

    with assert_raises(NoArgumentError):
        al.total_number_results(dictionary)
def test_total_number_results_wrong_feed():

    dictionary = {'key1': 1, 'key2': 'hello', 'feed': 'this is a string'}

    with assert_raises(TypeError):
        al.total_number_results(dictionary)
def test_total_number_results_wrong_argument():

    not_dictionary = 'This is a string'

    with assert_raises(TypeError):
        al.total_number_results(not_dictionary)