This repository has been archived on 2015-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
psh/test/utils.py
2015-02-26 18:08:01 -05:00

19 lines
479 B
Python

from psh.commands import BaseCommand
from io import StringIO
class TestFormatter(BaseCommand):
def __init__(self, *args, **kwargs):
super(TestFormatter, self).__init__(*args, **kwargs)
self.buffer = StringIO()
def call(self):
input_generator = self.get_input_generator()
for line in input_generator:
self.buffer.write(line.decode('utf-8'))
return None
def get_data(self):
return self.buffer.getvalue()