|
4 | 4 |
|
5 | 5 | import pytest |
6 | 6 | from tests.integration.conftest import append_profile |
7 | | -from tests.integration.util import DataServer |
8 | 7 |
|
9 | 8 | from code42cli.main import cli |
10 | 9 |
|
11 | 10 |
|
12 | 11 | @pytest.mark.integration |
13 | | -@pytest.mark.parametrize( |
14 | | - "protocol", ["TCP", "UDP"], |
15 | | -) |
16 | | -def test_security_data_send_to_return_success_return_code( |
17 | | - runner, integration_test_profile, protocol |
| 12 | +def test_security_data_send_to_tcp_return_success_return_code( |
| 13 | + runner, integration_test_profile, tcp_dataserver |
18 | 14 | ): |
19 | 15 | begin_date = datetime.utcnow() - timedelta(days=20) |
20 | 16 | begin_date_str = begin_date.strftime("%Y-%m-%d") |
21 | | - command = "security-data send-to localhost:5140 -p {} -b {}".format( |
22 | | - protocol, begin_date_str |
| 17 | + command = append_profile( |
| 18 | + f"security-data send-to localhost:5140 -p TCP -b '{begin_date_str}'" |
23 | 19 | ) |
24 | | - with DataServer(protocol=protocol): |
25 | | - result = runner.invoke(cli, split_command(append_profile(command))) |
| 20 | + result = runner.invoke(cli, split_command(command)) |
| 21 | + assert result.exit_code == 0 |
| 22 | + |
| 23 | + |
| 24 | +@pytest.mark.integration |
| 25 | +def test_security_data_send_to_udp_return_success_return_code( |
| 26 | + runner, integration_test_profile, udp_dataserver |
| 27 | +): |
| 28 | + begin_date = datetime.utcnow() - timedelta(days=20) |
| 29 | + begin_date_str = begin_date.strftime("%Y-%m-%d") |
| 30 | + command = append_profile( |
| 31 | + f"security-data send-to localhost:5141 -p UDP -b '{begin_date_str}'" |
| 32 | + ) |
| 33 | + result = runner.invoke(cli, split_command(command)) |
26 | 34 | assert result.exit_code == 0 |
0 commit comments