Exemplo n.º 1
0
 def test_merge_sort(self):
     """
     Merge sort test
     :return:
     """
     self.test_list = rand_int_list(self.list_min_val, self.list_max_val,
                                    self.list_size)
     merge_sort(self.test_list)
     for i in range(0, len(self.test_list)):
         if i > 0:
             self.assertLessEqual(self.test_list[i - 1], self.test_list[i])
Exemplo n.º 2
0
 def setUp(self):
     """
     setting up the inititals:
     low border, high border, list size and creates the list
     :return:
     """
     self.list_min_val = 11
     self.list_max_val = 999
     self.list_size = 30
     self.test_list = rand_int_list(self.list_min_val, self.list_max_val,
                                    self.list_size)
Exemplo n.º 3
0
    def setUp(self):
        """
        setting up the inititals:
        low border, high border, list size and creates the list
        setting up the search values.
        :return:
        """
        self.list_min_val = 11
        self.list_max_val = 999
        self.list_size = 30
        self.test_list = rand_int_list(self.list_min_val, self.list_max_val,
                                       self.list_size)

        self.test_list.sort()
        self.rnd_sval = random.choice(self.test_list)
        self.min_sval = self.test_list[0]
        self.max_sval = self.test_list[self.list_size - 1]
        self.min_notinlist = self.list_min_val // 2
        self.max_notinlist = self.list_max_val * 2
        self.listrange_notinlist = self.test_list[0] + 1