Skip to content

Commit 3eafcf4

Browse files
committed
Add configurable REST Catalog to test suite
1 parent 6e018c8 commit 3eafcf4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/integration/test_catalog.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
import json
19+
import os
1820
from pathlib import Path, PosixPath
1921
from typing import Generator, List
2022

@@ -74,6 +76,21 @@ def rest_catalog() -> Generator[Catalog, None, None]:
7476
clean_up(test_catalog)
7577

7678

79+
@pytest.fixture(scope="function")
80+
def rest_catalog_env() -> Generator[Catalog, None, None]:
81+
properties_json = os.environ.get("PYICEBERG_REST_CATALOG_PROPERTIES")
82+
if properties_json:
83+
properties = json.loads(properties_json)
84+
test_catalog = RestCatalog(
85+
"rest_env",
86+
**properties,
87+
)
88+
yield test_catalog
89+
clean_up(test_catalog)
90+
else:
91+
pytest.skip("REST catalog environment variables not set")
92+
93+
7794
@pytest.fixture(scope="function")
7895
def hive_catalog() -> Generator[Catalog, None, None]:
7996
test_catalog = HiveCatalog(
@@ -95,6 +112,7 @@ def hive_catalog() -> Generator[Catalog, None, None]:
95112
pytest.lazy_fixture("sqlite_catalog_file"),
96113
pytest.lazy_fixture("rest_catalog"),
97114
pytest.lazy_fixture("hive_catalog"),
115+
pytest.lazy_fixture("rest_catalog_env"),
98116
]
99117

100118

0 commit comments

Comments
 (0)