Exemple #1
0
 def get_file_text(self, file_id, path=None):
     chunks = self.backing_tree.get_file_lines(file_id, path)
     if path is None:
         path = self.backing_tree.id2path(file_id)
     filters = self.filter_stack_callback(path)
     context = ContentFilterContext(path, self, None)
     contents = filtered_output_bytes(chunks, filters, context)
     content = ''.join(contents)
     return content
Exemple #2
0
 def test_filter_context_with_path(self):
     ctx = ContentFilterContext('foo/bar')
     self.assertEqual('foo/bar', ctx.relpath())
Exemple #3
0
 def test_empty_filter_context(self):
     ctx = ContentFilterContext()
     self.assertEqual(None, ctx.relpath())
Exemple #4
0
 def test_filter_context_with_path(self):
     ctx = ContentFilterContext('foo/bar')
     self.assertEquals('foo/bar', ctx.relpath())
Exemple #5
0
 def test_empty_filter_context(self):
     ctx = ContentFilterContext()
     self.assertEqual(None, ctx.relpath())