예제 #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)
예제 #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())
예제 #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)
예제 #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")
예제 #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")
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)