-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert-from-legacy to "dirac internal legacy cs-sync"
- Loading branch information
Showing
9 changed files
with
95 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from pathlib import Path | ||
|
||
import yaml | ||
from typer.testing import CliRunner | ||
|
||
from diracx.cli import app | ||
|
||
runner = CliRunner() | ||
|
||
file_path = Path(__file__).parent | ||
|
||
|
||
def test_cs_sync(tmp_path, monkeypatch): | ||
monkeypatch.setenv("DIRAC_COMPAT_ENABLE_CS_CONVERSION", "Yes") | ||
|
||
output_file = tmp_path / "default.yaml" | ||
|
||
result = runner.invoke( | ||
app, | ||
[ | ||
"internal", | ||
"legacy", | ||
"cs-sync", | ||
f"{file_path / 'integration_test.cfg'}", | ||
f"{file_path / 'convert_integration_test.yaml'}", | ||
str(output_file), | ||
], | ||
) | ||
assert result.exit_code == 0 | ||
assert output_file.is_file() | ||
|
||
actual_output = yaml.safe_load(output_file.read_text()) | ||
expected_output = yaml.safe_load((file_path / "integration_test.yaml").read_text()) | ||
assert actual_output == expected_output |