def test_dump_yaml_str_input_check(mocker, dump_yaml_defaults): data = 'some-data' run_m = mocker.patch.object(utils.yaml, 'dump', autospec=True) utils.dump_yaml_str(data) run_m.assert_called_once_with(data, **dump_yaml_defaults)
def test_dump_yaml_str_output_check(mocker): in_data = 'some-in-data' out_data = 'some-out-data' mocker.patch.object( utils.yaml, 'safe_dump', autospec=True, return_value=out_data ) assert utils.dump_yaml_str(in_data) == out_data
def run(self): return utils.dump_yaml_str(self.build())