MockPythonBindings.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <PythonBindings.h>
  10. #include <gmock/gmock.h>
  11. namespace O3DE::ProjectManager
  12. {
  13. class MockPythonBindings : public PythonBindings
  14. {
  15. public:
  16. // Python
  17. MOCK_METHOD0(PythonStarted, bool());
  18. MOCK_METHOD0(StopPython, bool());
  19. // Engine
  20. MOCK_METHOD0(GetEngineInfo, AZ::Outcome<EngineInfo>());
  21. MOCK_METHOD1(GetEngineInfo, AZ::Outcome<EngineInfo>(const QString&));
  22. MOCK_METHOD2(SetEngineInfo, DetailedOutcome(const EngineInfo&, bool force));
  23. // Gem
  24. MOCK_METHOD3(CreateGem, AZ::Outcome<GemInfo>(const QString&, const GemInfo&, bool));
  25. MOCK_METHOD2(GetGemInfo, AZ::Outcome<GemInfo>(const QString&, const QString&));
  26. MOCK_METHOD1(GetAllGemInfos, AZ::Outcome<QVector<GemInfo>, AZStd::string>(const QString&));
  27. MOCK_CONST_METHOD2(GetEnabledGems, AZ::Outcome<QHash<QString, QString>, AZStd::string>(const QString&, bool includeDependencies));
  28. MOCK_METHOD2(RegisterGem, AZ::Outcome<void, AZStd::string>(const QString&, const QString&));
  29. MOCK_METHOD2(UnregisterGem, AZ::Outcome<void, AZStd::string>(const QString&, const QString&));
  30. // Project
  31. MOCK_METHOD3(CreateProject, AZ::Outcome<ProjectInfo, IPythonBindings::ErrorPair>(const QString&, const ProjectInfo&, bool));
  32. MOCK_METHOD1(GetProject, AZ::Outcome<ProjectInfo>(const QString&));
  33. MOCK_METHOD0(GetProjects, AZ::Outcome<QVector<ProjectInfo>>());
  34. MOCK_METHOD2(AddProject, DetailedOutcome(const QString&, bool));
  35. MOCK_METHOD1(RemoveProject, DetailedOutcome(const QString&));
  36. MOCK_METHOD1(UpdateProject, AZ::Outcome<void, AZStd::string>(const ProjectInfo&));
  37. MOCK_METHOD3(GetIncompatibleProjectGems, AZ::Outcome<QStringList, AZStd::string>(const QStringList&, const QStringList&, const QString&));
  38. MOCK_METHOD2(GetProjectEngineIncompatibleObjects, AZ::Outcome<QStringList, ErrorPair>(const QString&, const QString&));
  39. MOCK_METHOD4(AddGemsToProject, DetailedOutcome(const QStringList&, const QStringList&, const QString&, bool));
  40. MOCK_METHOD2(RemoveGemFromProject, AZ::Outcome<void, AZStd::string>(const QString&, const QString&));
  41. MOCK_METHOD0(RemoveInvalidProjects, bool());
  42. // ProjectTemplate
  43. MOCK_METHOD0(GetProjectTemplates, AZ::Outcome<QVector<ProjectTemplateInfo>>());
  44. MOCK_CONST_METHOD1(GetProjectTemplatesForAllRepos, AZ::Outcome<QVector<ProjectTemplateInfo>>(bool));
  45. MOCK_METHOD0(GetGemTemplates, AZ::Outcome<QVector<TemplateInfo>>());
  46. // Gem Repos
  47. MOCK_METHOD2(RefreshGemRepo, AZ::Outcome<void, AZStd::string>(const QString&, bool));
  48. MOCK_METHOD1(RefreshAllGemRepos, bool(bool));
  49. MOCK_METHOD1(AddGemRepo, DetailedOutcome(const QString&));
  50. MOCK_METHOD1(RemoveGemRepo, bool(const QString&));
  51. MOCK_METHOD0(GetAllGemRepoInfos, AZ::Outcome<QVector<GemRepoInfo>, AZStd::string>());
  52. MOCK_METHOD2(GetGemInfosForRepo, AZ::Outcome<QVector<GemInfo>, AZStd::string>(const QString&, bool));
  53. MOCK_METHOD2(GetGemInfosForAllRepos, AZ::Outcome<QVector<GemInfo>, AZStd::string>(const QString&, bool));
  54. MOCK_METHOD4(DownloadGem, DetailedOutcome(const QString&, const QString&, std::function<void(int, int)>, bool));
  55. MOCK_METHOD0(CancelDownload, void());
  56. MOCK_METHOD2(IsGemUpdateAvaliable, bool(const QString&, const QString&));
  57. // Errors
  58. MOCK_METHOD1(AddErrorString, void(AZStd::string));
  59. };
  60. } // namespace UnitTest