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