示例#1
0
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)
示例#2
0
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
示例#3
0
 def run(self):
     return utils.dump_yaml_str(self.build())