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

Fix boto_apigateway tests for PyYAML 5.1 #52783

Merged
merged 1 commit into from May 2, 2019

Conversation

@Ch3LL
Copy link
Contributor

commented May 1, 2019

What does this PR do?

Fixes the tests on Fedora:

unit.states.test_boto_apigateway.BotoApiGatewayTestCase.test_present_when_stage_exists_and_is_to_associate_to_existing_deployment
unit.states.test_boto_apigateway.BotoApiGatewayTestCase.test_present_when_stage_is_already_at_desired_deployment 
unit.states.test_boto_apigateway.BotoApiGatewayTestCase.test_present_when_stage_is_already_at_desired_deployment_and_needs_stage_variables_update

In PyYAML 5 the commit here: yaml/pyyaml@507a464 made default_flow_style=False. Because of this difference it changes what is dumped into the temp-swagger-sample.yaml file.

Given this code:

import yaml

with open('/tmp/test', 'w') as blah:
    yaml.safe_dump({'blah': {'one': 'two'}}, blah)

the following gets dumped into the file:

PyYAML 3.13

blah: {one: two}

PyYAML 5.1

blah:
  one: two

The test was initially written with a pyyamml version <5.1 and created a hash based on that. The tests are failing because the hash is not comparing correctly. This change will force yaml regardless of what version to use default_flow_style=False to dump this test file. I tested this on both PyYaml versions and the tests passed.

What issues does this PR fix or reference?

Fixes #52461

Tests written?

No - fixing a test

Commits signed with GPG?

Yes

@Ch3LL Ch3LL referenced this pull request May 1, 2019
@s0undt3ch s0undt3ch merged commit 316d05b into saltstack:2019.2.1 May 2, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.