delfick / bespin

Opinionated wrapper around boto that reads yaml
MIT License
6 stars 8 forks source link

Add tests for bespin.amazon.credentials #44

Closed atward closed 7 years ago

atward commented 7 years ago

Oh python2.6. You so silly.

delfick commented 7 years ago

So anyway, these tests were breaking in tox because of this https://github.com/delfick/bespin/commit/8b6fad9b34f371eb84749953652d44033f9c98d9 (tox doesn't set a USER variable and so that code was breaking the response from moto)

And also, https://github.com/delfick/bespin/commit/1b79a338bb4d729d65672da0972dad5e7d392a27, environment variables from one test was changing the behaviour of another test.

atward commented 7 years ago

Would it be better/possible to mock a clone of os.environ for the particular unittests which would modify the environment?

delfick commented 7 years ago

possibly, should be possible with mock.patch.dict https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch.dict

atward commented 7 years ago

unittest.mock is only available post python 3.3

delfick commented 7 years ago

that's why it's a dep in setup.py https://github.com/delfick/bespin/blob/master/setup.py#L37