waft.framework_unit_tests.test_cli.test_systems_default module

Unit tests for SystemsDefault handling in CLI commands.

These tests verify that SystemsDefault sentinel values are properly resolved when config files don’t exist or are empty, preventing sentinel strings like ‘“default” | ALL’ from leaking through to Waft instances.

class waft.framework_unit_tests.test_cli.test_systems_default.MockContext(config_path: str | None = None)

Bases: object

Mock typer context for testing _resolve_systems callback.

resilient_parsing = False
class waft.framework_unit_tests.test_cli.test_systems_default.TestCallbackSystemsRequired

Bases: object

Test callback_systems_required doesn’t pass sentinel values to Waft.

test_legitimate_default_group_not_filtered(tmp_path)

Verify a group named ‘default’ with multiple systems is NOT filtered.

A user may have a group named ‘default’ containing multiple systems. When the callback resolves this group, it returns system names like [‘system1’, ‘system2’] - these should NOT be filtered by the sentinel guard.

test_sentinel_defaults_to_local(tmp_path)

Verify sentinel strings are filtered and defaults to local node.

class waft.framework_unit_tests.test_cli.test_systems_default.TestDownloadCliWithMissingConfig

Bases: object

Test download CLI commands handle missing config gracefully.

test_download_clients_with_missing_config(tmp_path)

Test ‘waft download warp clients’ doesn’t fail with sentinel error.

This reproduces the exact failure from job 16375345.

class waft.framework_unit_tests.test_cli.test_systems_default.TestSystemsDefaultResolution

Bases: object

Test that SystemsDefault sentinel values are properly resolved.

test_systems_default_all_with_empty_config(tmp_path)

Test SystemsDefault.ALL resolves to [‘local’] when config has no systems.

test_systems_default_all_with_missing_config(tmp_path)

Test SystemsDefault.ALL resolves to [‘local’] when config doesn’t exist.

This is the root cause of job 16375345 failure - when config file doesn’t exist and SystemsDefault.ALL is used, the sentinel string ‘“default” | ALL’ was leaking through to Waft, causing ValueError.

test_systems_default_all_with_systems_in_config(tmp_path)

Test SystemsDefault.ALL resolves to all systems when config has systems.

test_systems_default_local_with_missing_config(tmp_path)

Test SystemsDefault.LOCAL resolves to [‘local’] when config doesn’t exist.

test_systems_default_none_with_missing_config(tmp_path)

Test SystemsDefault.NONE resolves to empty list when config doesn’t exist.