-
Notifications
You must be signed in to change notification settings - Fork 28
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
Added test case for order of calls for playback (see issue #33) #37
base: develop
Are you sure you want to change the base?
Conversation
vlcinsky
commented
Feb 19, 2016
modified: tests/unit/test_canned.py
Looks like you just have to specify a region when you create the Session object. |
modified: tests/unit/test_canned.py
I wonder, if Session shall always get Anyway, I added
If I run it locally, it ignores the pill mode being |
You can't create a client without specifying a region somewhere. It can come from your config file, from an environment variable, you can specify it when creating the Session or when creating the client but a client needs to know which endpoint it is talking to. |
I will have to accept you are correct with region_name being required for creating a session. Since I use mostly S3 services and since bucket names are using global (unique across all regions) scope, I was always expecting, that I shall get the bucket without taking care about region it resides at. Despite the fact, there is some logic in my requirement, there are practical consequences, that in many cases it could cause additional request to AWS which can cost something and which can be avoided, if region is known. So thanks - from this issue I take away the fact, region_name is really required (from somewhere) for a session. |
Just to be clear, a region is not required to create a Session but it is required to create a client/resource. The error that you are getting in the tests right now is because you are not configuring the session to use the fake credential file in the test directory. If you look at this, you can see the Session is being created using the Does that make sense? |
@vlcinsky I'm trying to understand how to use placebo and I came across your PR. This snip right here is calling boto before the placebo is able to replay the data. This makes a real API call. If the region is not provided when creating a session. Then boto will search for the aws config file or env vars to find it. See Configuring Credentials
These two tests are not making a real API call but using the recorded data.
Everything worked as expected. Note I have a ~/.aws/config file. I hope this helps. Not sure if this PR is needed to stay open @garnaat ? |