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
def test_filter_context_with_path(self): ctx = ContentFilterContext('foo/bar') self.assertEqual('foo/bar', ctx.relpath())
def test_empty_filter_context(self): ctx = ContentFilterContext() self.assertEqual(None, ctx.relpath())
def test_filter_context_with_path(self): ctx = ContentFilterContext('foo/bar') self.assertEquals('foo/bar', ctx.relpath())