shawnsi / docker-rpmbuild

Docker wrapper for rpmbuild
MIT License
18 stars 5 forks source link

Revert using real file in test #8

Closed norrs closed 10 years ago

norrs commented 10 years ago

You want to revert https://github.com/shawnsi/docker-rpmbuild/commit/631c073a2aafa642dd9e2be72e27e34e3d2f1d6f, you don't want to involve real files in a unit test (NamedTemporaryFile) . Make integration tests incase you want that. (that's why we only assert that the mock is called once with the same argument given in --config.

shawnsi commented 10 years ago

os.path.exists on line 44 in config.py was breaking test_get_docker_config_is_type_defaultdict. NameTemporaryFile is portable across python 2/3 and fixes the test case. I suppose we could mock os.path.exists to complete this test without using a real file?

norrs commented 10 years ago

Yup, I'll see if I have any spare time after work to fix this tiny TODO.

shawnsi commented 10 years ago

I took a swing at this in @58d3665ee16bcf52f5db57a098ddbe8fcd880da0. If it looks good to you I'll merge to master.

norrs commented 10 years ago

Go a head :-)