Skip to content

SG-34359 Add field type entity_type to mockgun as simple str #319

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

Conversation

slingshotsys
Copy link
Contributor

For testing purposes, it can be helpful to support entity_type field types, even if there's no validation that it's an existing Entity from the schema.

@carlos-villavicencio-adsk
Copy link
Contributor

Hello, thank you for the contribution. Can you provide a use case when this is helpful? Cheers

@slingshotsys
Copy link
Contributor Author

Hey Carlos,

I was adding tests for code that creates ActionMenuItems on a site through the Python API. So I wanted to assert they were created in Mockgun.

The following code:

    sg_amis = mockgun.find(
        "ActionMenuItem",
        filters=[],
        fields=[
            "title",
            "entity_type",
        ],
    )

results in ShotgridError: Field ActionMenuItem.entity_type: Handling for ShotGrid type entity_type is not implemented

As far as I can tell, entity_type fields in Shotgrid are just text fields, maybe limited to a specific set of values matching the entities available in the Shotgrid site. I suppose in Mockgun you could add some validation to verify that the value of entity_type fields exists as an entity name in the Schema, but for my purposes just setting it to a string worked great.

Thanks!

@carlos-villavicencio-adsk
Copy link
Contributor

I think it's a good idea to add entity_type. Thanks. Our team will review this and merge as soon as they can.

@carlos-villavicencio-adsk carlos-villavicencio-adsk changed the title add field type entity_type to mockgun as simple str SG-34359 Add field type entity_type to mockgun as simple str Jan 22, 2024
@slingshotsys slingshotsys deleted the add-entity_type-to-mockgun branch April 27, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants