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

Method test_command_failure

tests/usage/test_usage_lib.py:73–81  ·  view source on GitHub ↗

Test when command fails

(self, mock_run)

Source from the content-addressed store, hash-verified

71
72 @patch("fastdeploy.usage.usage_lib.subprocess.run")
73 def test_command_failure(self, mock_run):
74 """Test when command fails"""
75 mock_result = Mock()
76 mock_result.returncode = 1
77 mock_result.stdout = ""
78 mock_run.return_value = mock_result
79
80 result = get_xpu_model()
81 self.assertIsNone(result)
82
83 @patch("fastdeploy.usage.usage_lib.subprocess.run")
84 def test_no_matching_pattern(self, mock_run):

Callers

nothing calls this directly

Calls 1

get_xpu_modelFunction · 0.90

Tested by

no test coverage detected