-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MAINTAINCE] read config file instead using datacontext (#74)
* feat: read config file
- Loading branch information
1 parent
3d10d13
commit a9bbd95
Showing
2 changed files
with
31 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
import pytest | ||
from functions.data_test.profiling import (add_local_s3_to_stores) | ||
from functions.data_test.profiling import (add_local_s3_to_stores, | ||
read_gx_config_file) | ||
|
||
ENDPOINT_URL = "http://localhost:4566" | ||
|
||
|
||
@pytest.mark.parametrize("stores, expected_output", [ | ||
({"store1": {"store_backend": {"type": "s3", "bucket": "my-bucket"}}}, | ||
{"store1": {"store_backend": {"type": "s3", "bucket": "my-bucket", "boto3_options": {"endpoint_url": "http://localhost:4566"}}}}), | ||
{"store1": {"store_backend": {"type": "s3", "bucket": "my-bucket", | ||
"boto3_options": | ||
{"endpoint_url": ENDPOINT_URL}}}}), | ||
({}, {}) | ||
]) | ||
def test_add_local_s3_to_stores(stores, expected_output): | ||
endpoint_url = "http://localhost:4566" | ||
assert add_local_s3_to_stores(stores, endpoint_url) == expected_output | ||
assert add_local_s3_to_stores(stores, ENDPOINT_URL) == expected_output | ||
|
||
|
||
def test_gx_config_file(): | ||
config_file = read_gx_config_file() | ||
assert config_file["config_version"] == 2.0 | ||
|
||
|
||
def test_gx_config_file_path_is_not_none(tmpdir): | ||
p = tmpdir.mkdir("config").join("great_expectations.yml") | ||
p.write("config_version: 10.0") | ||
config_file = read_gx_config_file(path=p) | ||
assert config_file["config_version"] == 10.0 |