def test_incorrect_argument():
    assert exception_catcher(frequency_sort,
                             4.4) == TypeError, "Incorrect argument"
def test_incorrect_argument():
    assert exception_catcher(non_unique_elements,
                             53556) == TypeError, "Incorrect argument"
def test_no_arguments():
    assert exception_catcher(frequency_sort) == TypeError, "No arguments"
Ejemplo n.º 4
0
def test_incorrect_arguments():
    assert exception_catcher(popular_words, 343, 345) == AttributeError, "Incorrect arguments"
def test_zero_arguments():
    assert exception_catcher(non_unique_elements) == TypeError, "No arguments"
Ejemplo n.º 6
0
def test_zero_arguments():
    assert exception_catcher(popular_words) == TypeError, "Zero arguments"
Ejemplo n.º 7
0
def test_two_lists():
    assert exception_catcher(popular_words, ["Test", "text", "test", "spam"], ["test"]) == AttributeError, "Two lists"
def test_incorrect_argument():
    assert exception_catcher(most_wanted_letter, 123456) == AttributeError
def test_zero_arguments():
    assert exception_catcher(most_wanted_letter) == TypeError, "Zero arguments"
Ejemplo n.º 10
0
               {"name": "iphone", "price": 200},
               {"name": "samsung", "price": 150},
               {"name": "meizu", "price": 100}
           ], "Limit out of range"

    assert bigger_price(-1, [
        {"name": "pen", "price": 5},
        {"name": "whiteboard", "price": 170}
    ]) == [{"name": "whiteboard", "price": 170}], "Negative index"

    assert bigger_price(0, [
        {"name": "Eggs", "price": 82}
    ]) == [], "Limit not given"

    assert bigger_price(1, [
        {"name": "spam"}
    ]) == [{"name": "spam"}], "No price"
    assert bigger_price(2, [
        {"name": "a", "price": 100},
        {"name": "c", "price": 100},
        {"name": "b", "price": 100}
    ]) == [{"name": "a", "price": 100}, {"name": "c", "price": 100}], "Equal price"
    assert bigger_price(2, [
        {"name": "a", "price": 1.1 + 2.2},
        {"name": "c", "price": 1.1 + 2.2},
        {"name": "b", "price": 1.1 + 2.2}
    ]) == [{"name": "a", "price": 3.3}, {"name": "c", "price": 3.3}], "Float equal price"
    assert exception_catcher(bigger_price) == TypeError, "Arguments not filled"
    assert exception_catcher(bigger_price, 4, 5) == TypeError, "Incorrect arguments"
    assert exception_catcher(bigger_price, 5) == TypeError, "Missing one argument"