Exemplo n.º 1
0
 def test_bubblesort__error_descending(self):
     list = [1, 4, 5.77, 2, "a"]
     with pytest.raises(TypeError):
         bubblesort(list, descending=True)
Exemplo n.º 2
0
 def test_bubblesort__on_empty_list_descending(self):
     assert bubblesort([], descending=True) == []
Exemplo n.º 3
0
 def test_bubblesort__on_single_float_descending(self):
     list = _create_list_of_floats(1)
     list_copy = list[:]
     assert bubblesort(list, descending=True) == sorted(list_copy,
                                                        reverse=True)
Exemplo n.º 4
0
 def test_bubblesort__on_integers_descending(self):
     list = _create_list_of_integers(25)
     list_copy = list[:]
     assert bubblesort(list, descending=True) == sorted(list_copy,
                                                        reverse=True)
Exemplo n.º 5
0
 def test_bubblesort__error(self):
     list = [1, 4, 5.77, 2, "a"]
     with pytest.raises(TypeError):
         bubblesort(list)
Exemplo n.º 6
0
 def test_bubblesort__on_single_float(self):
     list = _create_list_of_floats(1)
     list_copy = list[:]
     assert bubblesort(list) == sorted(list_copy)
Exemplo n.º 7
0
 def test_bubblesort__on_empty_list(self):
     assert bubblesort([]) == []
Exemplo n.º 8
0
 def test_bubblesort__on_integers(self):
     list = _create_list_of_integers(25)
     list_copy = list[:]
     assert bubblesort(list) == sorted(list_copy)