|
7 | 7 |
|
8 | 8 | CDK_REPO_ROOT = Path(__file__).resolve().parents[3].absolute() |
9 | 9 |
|
| 10 | + |
10 | 11 | def check_local_repo_structure() -> bool: |
11 | 12 | """ |
12 | 13 | Check if the local repository structure is correct. |
13 | 14 | This function checks if the current working directory is 'airbyte-cdk'. |
14 | 15 | """ |
15 | | - return all([ |
16 | | - CDK_REPO_ROOT.name == "airbyte-python-cdk", |
17 | | - (CDK_REPO_ROOT.parent / "airbyte").is_dir(), |
18 | | - (CDK_REPO_ROOT.parent / "airbyte-enterprise").is_dir(), |
19 | | - (CDK_REPO_ROOT.parent / "airbyte" / "airbyte-integrations").is_dir(), |
20 | | - (CDK_REPO_ROOT.parent / "airbyte-enterprise" / "airbyte-integrations").is_dir(), |
21 | | - ]) |
| 16 | + return all( |
| 17 | + [ |
| 18 | + CDK_REPO_ROOT.name == "airbyte-python-cdk", |
| 19 | + (CDK_REPO_ROOT.parent / "airbyte").is_dir(), |
| 20 | + (CDK_REPO_ROOT.parent / "airbyte-enterprise").is_dir(), |
| 21 | + (CDK_REPO_ROOT.parent / "airbyte" / "airbyte-integrations").is_dir(), |
| 22 | + (CDK_REPO_ROOT.parent / "airbyte-enterprise" / "airbyte-integrations").is_dir(), |
| 23 | + ] |
| 24 | + ) |
22 | 25 |
|
23 | 26 |
|
24 | 27 | @pytest.mark.parametrize( |
25 | 28 | "start_dir_rel, expect_success", |
26 | 29 | [ |
27 | 30 | (CDK_REPO_ROOT / ".." / "airbyte", True), |
28 | 31 | (CDK_REPO_ROOT / ".." / "airbyte" / "airbyte-ci", True), |
29 | | - (CDK_REPO_ROOT.parent, True), # Parent directory from CDK repo |
30 | | - (CDK_REPO_ROOT.parent.parent, False), # Grandparent directory from CDK repo |
| 32 | + (CDK_REPO_ROOT.parent, True), # Parent directory from CDK repo |
| 33 | + (CDK_REPO_ROOT.parent.parent, False), # Grandparent directory from CDK repo |
31 | 34 | (CDK_REPO_ROOT / ".." / "airbyte-enterprise", True), |
32 | 35 | (CDK_REPO_ROOT / ".." / "airbyte-enterprise" / "airbyte-integrations", True), |
33 | 36 | (Path("/"), False), # Filesystem root |
@@ -77,6 +80,4 @@ def test_resolve_airbyte_repo_root_real_fs( |
77 | 80 | ) |
78 | 81 | except FileNotFoundError: |
79 | 82 | if expect_success: |
80 | | - raise AssertionError( |
81 | | - f"Airbyte repo root not found from '{start_dir_rel!s}'." |
82 | | - ) |
| 83 | + raise AssertionError(f"Airbyte repo root not found from '{start_dir_rel!s}'.") |
0 commit comments