1

I have some Python (v.3.x) that works like a charm on AWS using boto3 etc.. Now I'm asked to write some tests around that, so I found this to capture the response which I'll create the test around it:

https://github.com/garnaat/placebo

Using ptpython I'm able to run my code, but the recording is not happening (not that I can find), here's what I did:

session = boto3.Session()
pill = placebo.attach(session, data_path='/c/Users/myuser/placebo')
pill.record()
run my python code which does the job

The only thing I'm thinking right now is the fact I'm on Windows 7, maybe it's not accepting the path.
Any thoughts?

MarianD
  • 13,096
  • 12
  • 42
  • 54
Naim Salameh
  • 387
  • 4
  • 18
  • have you tried constructing your path with either `os.path.join` or [pathlib](https://docs.python.org/3/library/pathlib.html)? – Jordon Phillips May 25 '17 at 19:33
  • yes I did, the result is still the same, I'm keeping it super simple at this point but it's not working. I had a friend try to run it as well, again same result i.e. not working (only diff between us is he has windows 10) – Naim Salameh May 29 '17 at 08:33

1 Answers1

1

I solved the issue, this step is not included in the documentation above I found it elsewhere:

session = boto3.Session()
pill = placebo.attach(session, data_path='.')
pill.record()
ec2 = session.client('ec2', region_name='us-west-2')
response = ec2.describe_instances()

that got me a recording, from here I can do whatever boto3 code I want - hope this helps anyone.

Naim Salameh
  • 387
  • 4
  • 18