MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / test_file_not_found

Method test_file_not_found

tests/utils/test_version.py:35–37  ·  view source on GitHub ↗

测试文件不存在的情况

(self, mock_file)

Source from the content-addressed store, hash-verified

33
34 @patch("builtins.open", side_effect=FileNotFoundError)
35 def test_file_not_found(self, mock_file):
36 """测试文件不存在的情况"""
37 self.assertEqual(current_package_version(), "Unknown")
38
39 @patch("builtins.open", new_callable=mock_open, read_data="some other content")
40 def test_no_version_line(self, mock_file):

Callers

nothing calls this directly

Calls 1

current_package_versionFunction · 0.90

Tested by

no test coverage detected