rwnx / pynonymizer

A universal tool for translating sensitive production database dumps into anonymized copies.
https://pypi.org/project/pynonymizer/
MIT License
101 stars 38 forks source link

Restore stdin / stdout integration test #143

Closed rwnx closed 4 months ago

rwnx commented 5 months ago

Recently I replaced the integration tests using subprocess to using clirunner.invoke as it gives more detailed error feedback. However, I couldn't get the stdin / stdout to work.

Here's the test. Worst case, consider restoring this as a subprocess test?

def test_basic_stdin_stdout():
    with gzip.open(input_path) as gzip_file:
        gzip_raw = gzip_file.read()

        output = runner.invoke(app, 
            ["-i", "-", "-o", "-", "-s", strategy_path],
            input=gzip_raw,
        )

        assert output.exit_code == 0
        assert len(output.stdout) > 3 * ONE_MB
rwnx commented 4 months ago

fixed in #150