def test_two_files(self): runner = MRJobRunner(conf_paths=[]) runner._invoke_sort([self.a, self.b], self.out) self.assertEqual( list(open(self.out)), ['A\n', 'B\n', 'alligator\n', 'apple\n', 'ball\n', 'banana\n'])
def test_one_file(self): runner = MRJobRunner(conf_paths=[]) runner._invoke_sort([self.a], self.out) self.assertEqual(list(open(self.out)), ['A\n', 'alligator\n', 'apple\n'])
def test_one_file(self): runner = MRJobRunner(conf_paths=[]) self.addCleanup(runner.cleanup) runner._invoke_sort([self.a], self.out) with open(self.out) as out_f: self.assertEqual(list(out_f), ['A\n', 'alligator\n', 'apple\n'])
def test_two_files(self): runner = MRJobRunner(conf_paths=[]) self.addCleanup(runner.cleanup) runner._invoke_sort([self.a, self.b], self.out) with open(self.out) as out_f: self.assertEqual(list(out_f), ["A\n", "B\n", "alligator\n", "apple\n", "ball\n", "banana\n"])
def test_two_files(self): runner = MRJobRunner(conf_paths=[]) runner._invoke_sort([self.a, self.b], self.out) self.assertEqual(list(open(self.out)), ['A\n', 'B\n', 'alligator\n', 'apple\n', 'ball\n', 'banana\n'])