def test_extract_thread_list(self): with open(ATRACE_EXTRACTED_THREADS, 'r') as expected_file: expected = expected_file.read().strip() for dump_file_name in ATRACE_PS_DUMPS: with open(dump_file_name, 'r') as dump_file: ps_dump = dump_file.read() thread_names = atrace_agent.extract_thread_list(ps_dump) self.assertEqual(expected, str(thread_names))
def test_extract_thread_list(self): with contextlib.nested(open(ATRACE_EXTRACTED_THREADS, 'r'), open(ATRACE_THREAD_LIST)) as (f1, f2): atrace_result = f1.read() ps_dump = f2.read() thread_names = atrace_agent.extract_thread_list(ps_dump) self.assertEqual(atrace_result, str(thread_names))