MCPcopy
hub / github.com/QData/TextAttack / test_command_line_augmentation

Function test_command_line_augmentation

tests/test_command_line/test_augment.py:18–39  ·  view source on GitHub ↗
(name, command, outfile, sample_output_file)

Source from the content-addressed store, hash-verified

16)
17@pytest.mark.slow
18def test_command_line_augmentation(name, command, outfile, sample_output_file):
19 import os
20
21 # desired_text = open(sample_output_file).read().strip()
22 # Run command and validate outputs.
23 result = run_command_and_get_result(command)
24
25 assert result.stdout is not None
26 stdout = result.stdout.decode().strip()
27 print("stdout =>", stdout)
28 assert stdout == ""
29
30 assert result.stderr is not None
31 stderr = result.stderr.decode().strip()
32 print("stderr =>", stderr)
33 assert "Wrote 9 augmentations to augment_test.csv" in stderr
34
35 # Ensure CSV file exists, then delete it.
36 assert os.path.exists(outfile)
37 os.remove(outfile)
38
39 assert result.returncode == 0

Callers

nothing calls this directly

Calls 3

stripMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected