예제 #1
0
    def extract_todo(self, file: Path, content: str,
                     expected: List[Tuple[Path, int, str]]):
        """Test 'extract_todos' function.

        Parameters
        ----------
        file : pathlib.Path
            Test file path
        content : str
            Content of the test file
        expected : List
            List of expected todos
        """
        self.fs.create_file(file, contents=content)
        todos = extract_todos(file)
        self.assertListEqual(todos, expected)
예제 #2
0
 def test_go(self):
     """Test go-file."""
     fpath = os.path.join(self.path, "test.go")
     corr = [(fpath, 5, "test"), (fpath, 7, "test 2")]
     todos = extract_todo.extract_todos(fpath)
     self.assertListEqual(todos, corr)
예제 #3
0
 def test_cs(self):
     """Test cs-file."""
     fpath = os.path.join(self.path, "test.cs")
     corr = [(fpath, 1, "test"), (fpath, 7, "test 2")]
     todos = extract_todo.extract_todos(fpath)
     self.assertListEqual(todos, corr)
예제 #4
0
 def test_hpp(self):
     """Test hpp-file."""
     fpath = os.path.join(self.path, "test.hpp")
     corr = [(fpath, 1, "test"), (fpath, 3, "test 2")]
     todos = extract_todo.extract_todos(fpath)
     self.assertListEqual(todos, corr)
예제 #5
0
 def test_py(self):
     """Test py-file."""
     fpath = os.path.join(self.path, "test.py")
     corr = [(fpath, 1, "test"), (fpath, 5, "test 2")]
     todos = extract_todo.extract_todos(fpath)
     self.assertListEqual(todos, corr)
예제 #6
0
 def test_latex(self):
     """Test tex-file."""
     fpath = os.path.join(self.path, "test.tex")
     corr = [(fpath, 2, "test"), (fpath, 3, "test 2")]
     todos = extract_todo.extract_todos(fpath)
     self.assertListEqual(todos, corr)
예제 #7
0
 def test_java(self):
     """Test java-file."""
     fpath = os.path.join(self.path, "test.java")
     corr = [(fpath, 1, "test"), (fpath, 4, "test 2")]
     todos = extract_todo.extract_todos(fpath)
     self.assertListEqual(todos, corr)