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

make Policy init via duck typing #24

Merged
merged 1 commit into from Aug 29, 2016
Merged

make Policy init via duck typing #24

merged 1 commit into from Aug 29, 2016

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Aug 24, 2016

removes kwarg style input arguments

self.assertRaises(IOError, Policy, filePath="c:/policy.yaml")
self.assertRaises(IOError, Policy, filePath="c:/policy.paf")
self.assertRaises(IOError, Policy, filePath="c:/policy")
self.assertRaises(IOError, Policy, "c:/policy.yaml")
Copy link
Member

Choose a reason for hiding this comment

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

Can you rewrite these using with so it's clearer what the test is.

Copy link
Member

Choose a reason for hiding this comment

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

It's a shame FileNotFoundError seems to be Python 3 only.

@n8pease n8pease force-pushed the tickets/DM-7255 branch 4 times, most recently from a11c087 to a720368 Compare August 24, 2016 19:47
self.assertRaises(IOError, Policy, filePath="c:/policy.paf")
self.assertRaises(IOError, Policy, filePath="c:/policy")
# Test that loading paf & yaml files that do not exist raises an IOError.
self.assertRaises(IOError, Policy, "c:/nonExistantPath/policy.yaml")
Copy link
Member

Choose a reason for hiding this comment

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

Please use

with self.assertRaises(IOError):
    Policy("c:....yaml")

as it is much clearer how the command is constructed that triggers the exception.

removes kwarg style input arguments
@n8pease n8pease merged commit 1a4a8c8 into master Aug 29, 2016
@ktlim ktlim deleted the tickets/DM-7255 branch August 25, 2018 06:14
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.

None yet

2 participants