Exemplo n.º 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
Exemplo n.º 2
0
 def test_filter_context_with_path(self):
     ctx = ContentFilterContext('foo/bar')
     self.assertEqual('foo/bar', ctx.relpath())
Exemplo n.º 3
0
 def test_empty_filter_context(self):
     ctx = ContentFilterContext()
     self.assertEqual(None, ctx.relpath())
Exemplo n.º 4
0
 def test_filter_context_with_path(self):
     ctx = ContentFilterContext('foo/bar')
     self.assertEquals('foo/bar', ctx.relpath())
Exemplo n.º 5
0
 def test_empty_filter_context(self):
     ctx = ContentFilterContext()
     self.assertEqual(None, ctx.relpath())