已合并
清除mock状态,避免影响下面测试的状态 #1056
chenzeyu创建于 6月9日
清除mock状态,避免影响下面测试的状态 #1056
已合并
共 1 个文件变更+7-4
| @@ -642,10 +642,13 @@ TEST_F(CommonUtilsTest, TestCheckIpEdgeCases) { | |||
| 642 | // 测试whl包场景,MINDIE_LLM_HOME_PATH 下存在 __init__.py,获取到 MINDIE_LLM_HOME_PATH 路径 | 642 | // 测试whl包场景,MINDIE_LLM_HOME_PATH 下存在 __init__.py,获取到 MINDIE_LLM_HOME_PATH 路径 |
| 643 | TEST_F(CommonUtilsTest, TestGetHomePathWhlPkgSuccess) { | 643 | TEST_F(CommonUtilsTest, TestGetHomePathWhlPkgSuccess) { |
| 644 | std::string homePath; | 644 | std::string homePath; |
| 645 | - auto existsMock = MOCKER(mindie_llm::FileSystem::Exists); | 645 | + { |
| 646 | - existsMock.stubs().with(any()).will(returnValue(true)); | 646 | + auto existsMock = MOCKER(mindie_llm::FileSystem::Exists); |
| 647 | - Error result = GetHomePath(homePath); | 647 | + existsMock.stubs().with(any()).will(returnValue(true)); |
| 648 | - EXPECT_TRUE(result.IsOk()); | 648 | + Error result = GetHomePath(homePath); |
| 649 | + EXPECT_TRUE(result.IsOk()); | ||
| 650 | + } | ||
| 651 | + GlobalMockObject::instance.reset(); | ||
| 649 | } | 652 | } |
| 650 | 653 | ||
| 651 | } // namespace mindie_llm | 654 | } // namespace mindie_llm |