示例#1
0
文件: __init__.py 项目: Brobin/faker
 def test_command(self):
     from faker.cli import Command
     orig_stdout = sys.stdout
     try:
         sys.stdout = StringIO()
         command = Command(['faker', 'address'])
         command.execute()
         assert sys.stdout.getvalue()
     finally:
         sys.stdout = orig_stdout
示例#2
0
 def test_command(self):
     from faker.cli import Command
     orig_stdout = sys.stdout
     try:
         sys.stdout = six.StringIO()
         command = Command(['faker', 'address'])
         command.execute()
         assert sys.stdout.getvalue()
     finally:
         sys.stdout = orig_stdout
示例#3
0
 def test_command_custom_provider(self):
     from faker.cli import Command
     orig_stdout = sys.stdout
     try:
         sys.stdout = StringIO()
         command = Command(['faker', 'foo', '-i', 'tests.mymodule.en_US'])
         command.execute()
         assert sys.stdout.getvalue()
     finally:
         sys.stdout = orig_stdout
示例#4
0
 def test_command_custom_provider(self):
     from faker.cli import Command
     orig_stdout = sys.stdout
     try:
         sys.stdout = six.StringIO()
         command = Command(['faker', 'foo', '-i', 'tests.mymodule.en_US'])
         command.execute()
         assert sys.stdout.getvalue()
     finally:
         sys.stdout = orig_stdout
示例#5
0
    def test_command_custom_provider(self):
        from faker.cli import Command

        orig_stdout = sys.stdout
        try:
            sys.stdout = io.StringIO()
            command = Command(["faker", "foo", "-i", "tests.mymodule.en_US"])
            command.execute()
            assert sys.stdout.getvalue()
        finally:
            sys.stdout = orig_stdout