Esempio n. 1
0
def test_get_versions_files(mocker, mocker_values, expected_output):
    glob_mocker = mocker.patch('glob.glob')
    glob_mocker.side_effect = mocker_values

    xml_f, bin_f, mapping = LocalModel.get_version_files('/data/model/3/')
    assert expected_output[0] == xml_f
    assert expected_output[1] == bin_f
    assert expected_output[2] is mapping
def test_get_versions_files(mocker):
    glob_mocker = mocker.patch('glob.glob')
    glob_mocker.side_effect = [['/data/model/3/model.bin'],
                               ['/data/model/3/model.xml'], []]

    xml, bin, mapping = LocalModel.get_version_files('/data/model/3/')
    assert xml == '/data/model/3/model.xml' and \
        bin == '/data/model/3/model.bin' and \
        mapping is None