Skip to content

Commit

Permalink
Fix config unit tests: ignore new config defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
natoverse committed Dec 26, 2024
1 parent 110009e commit 70366ac
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/unit/indexing/config/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def test_loading_default_config_with_input_overridden(self):

# Check that the config is merged
# but skip checking the input
self.assert_is_default_config(config, check_input=False)
self.assert_is_default_config(
config, check_input=False, ignore_workflows=["create_base_text_units"]
)

if config.input is None:
msg = "Input should not be none"
Expand Down Expand Up @@ -72,7 +74,10 @@ def assert_is_default_config(
check_reporting=True,
check_cache=True,
check_workflows=True,
ignore_workflows=None,
):
if ignore_workflows is None:
ignore_workflows = []
assert config is not None
assert isinstance(config, PipelineConfig)

Expand Down Expand Up @@ -111,7 +116,14 @@ def assert_is_default_config(
checked_config.pop(prop, None)
actual_default_config.pop(prop, None)

assert actual_default_config == actual_default_config | checked_config
for prop in actual_default_config:
if prop == "workflows":
assert len(checked_config[prop]) == len(actual_default_config[prop])
for i, workflow in enumerate(actual_default_config[prop]):
if workflow["name"] not in ignore_workflows:
assert workflow == actual_default_config[prop][i]
else:
assert checked_config[prop] == actual_default_config[prop]

def setUp(self) -> None:
os.environ["GRAPHRAG_OPENAI_API_KEY"] = "test"
Expand Down

0 comments on commit 70366ac

Please sign in to comment.