validations_common.tests.library.test_advanced_format module

class validations_common.tests.library.test_advanced_format.TestAdvancedFormat(*args: Any, **kwargs: Any)[source]

Bases: TestCase

setUp()[source]
test_advanced_format_attributes()[source]

Verify that module contains required attributes.

test_advanced_format_run_different_sizes(mock_safe_load, mock_ansible_module, mock_read_int)[source]

Verify that advanced_format correctly works with provided YAML.

test_advanced_format_run_same_sizes(mock_safe_load, mock_ansible_module, mock_read_int)[source]

Verify that advanced_format correctly works with provided YAML.

test_read_int(mock_open, mock_module)[source]
test_read_int_ioerror(mock_open, mock_module)[source]

Verify that IOError causes fail_json call.

As the msg argument is ultimately a string and subject to potential changes without effect on its function, we only verify the presence of call.

test_read_int_valueerror(mock_open, mock_module, mock_adv_format_int)[source]

Verify that ValueError raised by int conversion causes fail_json call.

As the msg argument is ultimately a string and subject to potential changes without effect on its function, we only verify the presence of call.