def test_find_ir_raises_file_not_found_error_when_ir_not_found(): with mock_filesystem(['foo/']) as root: with pytest.raises(FileNotFoundError): find_dlsdk_ir(root, 'model')
def test_find_ir__not_found(): with mock_filesystem(['foo/']) as root: model, weights = find_dlsdk_ir(root) assert model is None assert weights is None
def test_find_ir__in_root(): with mock_filesystem(['model.xml', 'model.bin']) as root: model, weights = find_dlsdk_ir(root, 'model') assert model == root / 'model.xml' assert weights == root / 'model.bin'
def test_find_ir__in_subdir(): with mock_filesystem(['foo/model.xml', 'foo/model.bin']) as root: model, weights = find_dlsdk_ir(root) assert model.endswith('.xml') assert weights.endswith('.bin')