PythonBindingTests.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include <AzCore/Component/Entity.h>
  9. #include <AzCore/RTTI/BehaviorContext.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. #include <AzTest/AzTest.h>
  12. #include <AzToolsFramework/Application/ToolsApplication.h>
  13. #include <AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h>
  14. #include <AzToolsFramework/Entity/EditorEntityContextComponent.h>
  15. #include <AzCore/UnitTest/TestTypes.h>
  16. namespace UnitTest
  17. {
  18. class AzToolsFrameworkPythonBindingsFixture
  19. : public ToolsApplicationFixture<>
  20. {
  21. };
  22. TEST_F(AzToolsFrameworkPythonBindingsFixture, AzToolsFrameworkToolsApplicationRequestBus_ApiExists)
  23. {
  24. AZ::BehaviorContext* behaviorContext = GetApplication()->GetBehaviorContext();
  25. ASSERT_TRUE(behaviorContext);
  26. auto toolsApplicationRequestBus = behaviorContext->m_ebuses.find("ToolsApplicationRequestBus");
  27. EXPECT_TRUE(behaviorContext->m_ebuses.end() != toolsApplicationRequestBus);
  28. }
  29. TEST_F(AzToolsFrameworkPythonBindingsFixture, AzToolsFrameworkToolsApplicationNotificationBus_ApiExists)
  30. {
  31. AZ::BehaviorContext* behaviorContext = GetApplication()->GetBehaviorContext();
  32. ASSERT_TRUE(behaviorContext);
  33. auto toolsApplicationNotificationBus = behaviorContext->m_ebuses.find("ToolsApplicationNotificationBus");
  34. EXPECT_TRUE(behaviorContext->m_ebuses.end() != toolsApplicationNotificationBus);
  35. }
  36. TEST_F(AzToolsFrameworkPythonBindingsFixture, AzToolsFrameworkEditorEntityContextNotificationBus_ApiExists)
  37. {
  38. AZ::BehaviorContext* behaviorContext = GetApplication()->GetBehaviorContext();
  39. ASSERT_TRUE(behaviorContext);
  40. auto editorEntityContextNotificationBus = behaviorContext->m_ebuses.find("EditorEntityContextNotificationBus");
  41. EXPECT_TRUE(behaviorContext->m_ebuses.end() != editorEntityContextNotificationBus);
  42. }
  43. TEST_F(AzToolsFrameworkPythonBindingsFixture, AzToolsFrameworkSliceRequestBus_ApiExists)
  44. {
  45. AZ::BehaviorContext* behaviorContext = GetApplication()->GetBehaviorContext();
  46. ASSERT_TRUE(behaviorContext);
  47. auto sliceRequestBus = behaviorContext->m_ebuses.find("SliceRequestBus");
  48. EXPECT_TRUE(behaviorContext->m_ebuses.end() != sliceRequestBus);
  49. }
  50. }