Beispiel #1
0
 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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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