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

update entity object with parametrized server_config rather default #1106

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

omkarkhatavkar
Copy link

@omkarkhatavkar omkarkhatavkar commented Mar 6, 2024

Description of changes

Currently server_config was not getting set while reading the entity API call using target_sat

        dom = target_sat.api.Domain(server_config=sc, id=dom.id).read()
        dom.organization = [filter_taxonomies['org']]
        with pytest.raises(HTTPError):
            dom.update(['organization']) 

After this PR the dom object or any other api component object can access the API calls using the custom server_config set by parameter .

@omkarkhatavkar omkarkhatavkar added the CherryPick PR needs CherryPick to previous branches label Mar 6, 2024
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.00%. Comparing base (2583225) to head (3e8f576).

Files Patch % Lines
nailgun/entity_mixins.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1106      +/-   ##
==========================================
- Coverage   92.03%   92.00%   -0.04%     
==========================================
  Files           6        6              
  Lines        3052     3053       +1     
==========================================
  Hits         2809     2809              
- Misses        243      244       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -k test_negative_assign_taxonomies_by_org_admin tests/foreman/api/test_role.py

Copy link
Contributor

@pondrejk pondrejk left a comment

Choose a reason for hiding this comment

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

tried with robottelo + nailgun with this PR fetched:

pytest tests/foreman/api/test_role.py -k test_negative_assign_taxonomies_by_org_admin
============================================= test session starts ==============================================
                                    

tests/foreman/api/test_role.py .                                                                         [100%]

@omkarkhatavkar
Copy link
Author

@pondrejk Do you have some more tests to try, just dont wanted to break something working

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo

1 similar comment
@omkarkhatavkar
Copy link
Author

trigger: test-robottelo

@omkarkhatavkar omkarkhatavkar requested a review from jyejare March 7, 2024 05:26
@pondrejk
Copy link
Contributor

pondrejk commented Mar 7, 2024

I ran some read queries with custom server config and the returned object contained the supplied credentials. When querying without any server config specified, the object contained default credentials as expected. When supplying invalid content as server config, exception is returned as expected. I'd say it's safe to get this in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z 6.13.z 6.14.z 6.15.z CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants