Skip to content

Commit

Permalink
Fix mock PE test (openvinotoolkit#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvafin authored Jan 16, 2023
1 parent b56b124 commit 8074456
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,12 @@ InputModel::Ptr FrontEndMockPy::load_impl(const std::vector<ov::Any>& params) co
m_telemetry->send_error("load_impl_error");
m_telemetry->send_stack_trace("mock_stack_trace");
}
if (!params.empty() && params[0].is<std::string>()) {
m_stat.m_load_paths.push_back(params[0].as<std::string>());
if (!params.empty()) {
if (params[0].is<std::string>()) {
m_stat.m_load_paths.push_back(params[0].as<std::string>());
} else {
throw ov::Exception("Only path is supported.");
}
}

return std::make_shared<InputModelMockPy>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def __str__(self):
fe = fem.load_by_framework(framework=MOCK_PY_FRONTEND_NAME)
assert fe is not None
with pytest.raises(RuntimeError) as e:
fe.load(str(TestClass()))
assert "Path: 'test class' does not exist. Please provide valid model's path either as a string, bytes or pathlib.Path" in str(e.value)
fe.load(TestClass())
assert "Only path is supported." in str(e.value)


@mock_needed
Expand Down

0 comments on commit 8074456

Please sign in to comment.