def test_copy_default_mailcap(): "Make sure the example mailcap file was included in the package" with NamedTemporaryFile() as fp: with mock.patch('rtv.config.six.moves.input', return_value='y'): copy_default_mailcap(fp.name) assert fp.read() # Check that the permissions were changed permissions = os.stat(fp.name).st_mode & 0o777 assert permissions == 0o664