diff --git a/src/agoradatatools/gx.py b/src/agoradatatools/gx.py index c45c1c2c..77a87a74 100644 --- a/src/agoradatatools/gx.py +++ b/src/agoradatatools/gx.py @@ -39,11 +39,9 @@ def __init__( ) def _get_data_context_location(self) -> str: - """Gets the absolute path to the great_expectations directory""" + """Gets the path to the great_expectations directory""" script_dir = os.path.dirname(os.path.realpath(__file__)) - parent_dir = os.path.dirname(script_dir) - project_dir = os.path.dirname(parent_dir) - gx_directory = os.path.join(project_dir, "great_expectations") + gx_directory = os.path.join(script_dir, "../../great_expectations") return gx_directory def _check_if_expectation_suite_exists(self) -> bool: diff --git a/tests/test_gx.py b/tests/test_gx.py index 1d00a8b2..c01fc5fe 100644 --- a/tests/test_gx.py +++ b/tests/test_gx.py @@ -48,12 +48,14 @@ def test_that_an_initialized_runner_has_the_attributes_it_should(self, syn): + "/gx/uncommitted/data_docs/local_site/validations" ) - def test_that_get_data_context_location_returns_the_absolute_path_to_the_gx_directory( + def test_that_get_data_context_location_returns_the_path_to_the_gx_directory( self, ): - assert self.good_runner._get_data_context_location() == os.path.join( - os.getcwd(), "great_expectations" + expected = os.path.join( + os.getcwd(), "src", "agoradatatools", "../..", "great_expectations" ) + result = self.good_runner._get_data_context_location() + assert result == expected def test_check_if_expectation_suite_exists_returns_false_when_the_expectation_suite_does_not_exist( self,