Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce data model unit tests #1443

Merged
merged 2 commits into from
Dec 9, 2024
Merged

Introduce data model unit tests #1443

merged 2 commits into from
Dec 9, 2024

Conversation

arielkr256
Copy link
Contributor

Background

There is currently no good way to test complex data model functions. This PR introduces a data_models_test.py to add this functionality, similar to global_helpers_test.py

Changes

  • add data_models_test.py with initial test case for AWS get_actor_user function
  • update Makefile

Testing

  • make test

@arielkr256 arielkr256 requested a review from a team as a code owner December 5, 2024 19:45
@arielkr256 arielkr256 added enhancement New feature or request data_models Updates or additions to Data Models and removed enhancement New feature or request labels Dec 5, 2024
class TestAWSCloudTrailDataModel(unittest.TestCase):
data_model = log_type_to_data_model.get("AWS.CloudTrail")

def test_get_actor_user(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this unit test tests the UDM, not the get_actor_user

@arielkr256 arielkr256 merged commit 5f0db64 into develop Dec 9, 2024
10 checks passed
@arielkr256 arielkr256 deleted the data-model-unit-tests branch December 9, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data_models Updates or additions to Data Models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants