Beispiel #1
0
 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)
Beispiel #2
0
    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())
Beispiel #3
0
 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)
Beispiel #4
0
 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")
Beispiel #5
0
 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")
Beispiel #6
0
 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)
Beispiel #7
0
 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)
Beispiel #8
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)
Beispiel #9
0
 def test_log_file_to_atoms_inline(self):
     atoms = watson.log_file_to_atoms(
         "testinputs/regressions/livenotesinline.md")
     self.assertEqual(len(atoms), 582)
Beispiel #10
0
 def test_midnight_bug(self):
     atoms = watson.log_file_to_atoms("testinputs/midnight.md")
     sessions = watson.get_sessions(atoms)
     self.assertEqual(len(sessions), 1)
Beispiel #11
0
 def test_journal_bug(self):
     atoms = watson.log_file_to_atoms("testinputs/strange.md")
     sessions = watson.get_sessions(atoms)
     self.assertEqual(len(sessions), 1)