Ejemplo n.º 1
0
def test_sort(arr):
    new_arr = sorted(arr)
    sort_and_search_array.sort_array(arr)
    if arr == new_arr:
        print("Test Passed")
    else:
        print("Test Failed")
Ejemplo n.º 2
0
def test_sort_array(self):
    n = r.array([9, 3, 1, 5, 8, 6, 4, 7])
    to_list = n.tolist()
    _list = to_list.sort()
    to_list = r.array(to_list)

    self.assertTrue(
        basic_list_exception.sort_array(
            ([9.0, 3.0, 1.0, 5.0, 8.0, 6.0, 4.0, 7.0])))
    """" I tried my bet, but I could not figure out the sort test"""
 def test_sort_array(self):
     self.assertEqual(
         sort_and_search_array.sort_array(arr.array('i', [3, 6, 1, 4, 2])),
         [1, 2, 3, 4, 6])
Ejemplo n.º 4
0
 def test_sort_array(self):
     self.assertEqual(a.sort_array([6, 4, 1]), None)
Ejemplo n.º 5
0
 def test_sort_inorder(self):
     self.assertEqual(array.sort_array(self.initial_array),
                      self.expected_array)
 def test_sort_list(self, input):
     self.assertEqual(topic1.sort_array(), arr.array('i', [5, 31, 45]))
Ejemplo n.º 7
0
 def test_sort_array(self):
     unsorted_array = arr.array('I', [99, 1, 4, 5, 36])
     sorted_array = arr.array('I', [1, 4, 5, 36, 99])
     self.assertEqual(sorted_array,
                      sort_and_search_array.sort_array(unsorted_array))
Ejemplo n.º 8
0
 def test_sort_array2(self, input):
     self.assertEqual(sort_and_search_array.sort_array(), [1, 11, 11])
Ejemplo n.º 9
0
 def test_sort_array_(self):
     result = sort_and_search_array.sort_array()
     self.assertEqual(result,
                      ['Brewers', 'Cardinals', 'Cubs', 'Pirates', 'Reds'])
 def test_sort_array(self):
     """Test search_list function for valid output of item not in list"""
     self.assertEqual(sort_array([6, 4, 9, 10]), [4, 6, 9, 10])
Ejemplo n.º 11
0
 def test_sort_array(self, input):
     x = make_array()
     self.assertEqual(sort_array(x), [3.0, 6.0, 45.0])
Ejemplo n.º 12
0
 def test_sort_list(self):
     self.assertEqual(sort_and_search_array.sort_array(anyList),
                      [1, 2, 3, 4, 5, 6, 7, 8])
Ejemplo n.º 13
0
 def test_sort_array(self):
     test_array = arr.array('i', [1, 3, 5, 7, 9, 0, 2, 4, 6, 8])
     self.assertEqual(SSarray.sort_array(test_array),
                      arr.array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))
Ejemplo n.º 14
0
 def test_sort_list(self):
     self.assertEqual(sort_array(x), [1, 4, 6])
Ejemplo n.º 15
0
 def test_sortList(self):
     self.assertEqual(ss.sort_array(), array('d', [11.5, 15.5, 20.5, 30.5]))
Ejemplo n.º 16
0
 def test_sort(self):
     the_array = arr.array('d', [3, 1, 2])
     topic1.sort_array(the_array)
     self.assertEqual(the_array, [1, 2, 3])
 def test_sort_array(self):
     self.assertEqual(ssa.sort_array(), None)
 def test_sort(self):
     test_array = arr.array('i', [-4, 2, 3, 45, 50, 66, 99])
     self.assertEqual(sort_array(), test_array)
Ejemplo n.º 19
0
 def test_array_sort(self):
     test_Array = array([6,5,4,3,2,1])
     self.assertListEqual([1,2,3,4,5,6], sort_and_search_array.sort_array(test_Array),)
Ejemplo n.º 20
0
 def test_sort_array1(self, input):
     self.assertEqual(sort_and_search_array.sort_array(), [9, 11, 45])