def test_listsorter_HeapSortAlreadySorted(self): ls = ListSorter() in_filename = "HeapSortData.csv" out_filename = "SortedByHeapSort.csv" self.create_csvfile_random_content(in_filename, 10) self.assertEqual(StatusCode.SUCCESS, ls.set_input_data(in_filename)) self.assertEqual(StatusCode.SUCCESS, ls.execute_heap_sort()) self.assertEqual(StatusCode.SUCCESS, ls.set_output_data(out_filename)) self.assertEqual(StatusCode.LIST_ALREADY_SORTED, ls.execute_heap_sort()) self.delete_file(in_filename) self.delete_file(out_filename)
def test_listsorter_HeapSortEmptyList(self): ls = ListSorter() self.assertEqual(StatusCode.LIST_IS_EMPTY, ls.execute_heap_sort())