def test_print_original_identity(self): atoms = watson.log_file_to_atoms("testinputs/strange.md") strange_text = watson.atoms_to_text(atoms) strange_text = strange_text.replace("\n\n", "\n") self.maxDiff = None print strange_text self.assertMultiLineEqual( open('testinputs/strange.md').read().strip(), strange_text)
def test_combination(self): TF = "%d-%b-%Y %H:%M" atoms = watson.camera_uploads_to_atoms("testinputs/images/") atoms.extend(watson.log_file_to_atoms("testinputs/augment1.md")) sorted_atoms = sorted(atoms, key=lambda x: x.get_S(), reverse=False) image_text = watson.atoms_to_text(sorted_atoms) image_text = image_text.replace("\n\n", "\n") self.maxDiff = None print image_text self.assertMultiLineEqual( open('testoutputs/augment1result.md').read().strip(), image_text.strip())
def test_make_sessions(self): atoms = watson.log_file_to_atoms("testinputs/regressions/livenotes.md") sessions = watson.get_sessions(atoms) self.assertEqual(len(sessions), 36)
def test_log_file_to_atoms_proper_title(self): atoms = watson.log_file_to_atoms( "testinputs/regressions/bug-with-markdown-links.md") self.assertEqual(atoms[0].title, "Bug with markdown links")
def test_log_file_to_atoms_blanktitle(self): atoms = watson.log_file_to_atoms("testinputs/regressions/livenotes.md") self.assertEqual(atoms[0].title, "testinputs/regressions/livenotes.md")
def test_split_on_title(self): atoms = watson.log_file_to_atoms("testinputs/splitontitle.md") sessions = watson.get_sessions(atoms) self.assertEqual(len(sessions), 9)
def test_log_file_to_atoms_problem(self): atoms = watson.log_file_to_atoms("testinputs/problem.md") sessions = watson.get_sessions(atoms) self.assertEqual(len(sessions), 0)
def test_log_file_to_atoms_inline_wrong(self): atoms = watson.log_file_to_atoms("testinputs/wrong.md") print atoms[0] sessions = watson.get_sessions(atoms) self.assertEqual(len(atoms), 1)
def test_log_file_to_atoms_inline(self): atoms = watson.log_file_to_atoms( "testinputs/regressions/livenotesinline.md") self.assertEqual(len(atoms), 582)
def test_midnight_bug(self): atoms = watson.log_file_to_atoms("testinputs/midnight.md") sessions = watson.get_sessions(atoms) self.assertEqual(len(sessions), 1)
def test_journal_bug(self): atoms = watson.log_file_to_atoms("testinputs/strange.md") sessions = watson.get_sessions(atoms) self.assertEqual(len(sessions), 1)