Skip to content

Conversation

@cfs-pure
Copy link
Contributor

Fix unittests for compatibility between Python 2 and 3.
Fixed a mock for open() in kmip.services.server.server

@codecov-io
Copy link

codecov-io commented Dec 22, 2016

Current coverage is 87.14% (diff: 100%)

Merging #238 into master will not change coverage

@@             master       #238   diff @@
==========================================
  Files            64         64          
  Lines          8409       8409          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           7328       7328          
  Misses         1081       1081          
  Partials          0          0          

Powered by Codecov. Last update d600a47...5be11db

@cfs-pure
Copy link
Contributor Author

The problems this pull request fixed came up when rebuilding the python-pykmip package from Ubuntu zesty (0.5.0-4) using the v0.6.0 tarball from PyPI. The Debian build uses python-coverage and not tox.

@PeterHamilton
Copy link
Contributor

I'm fine with the six.assertCountEqual and six.assertRaisesRegex changes. Can you provide more info on the mock.patch change with create=True? Was open not found when you were running the tests?

@cfs-pure
Copy link
Contributor Author

cfs-pure commented Jan 3, 2017

@PeterHamilton the mock was being applied to the kmip.services.server.server class which does not have an open method.

@PeterHamilton
Copy link
Contributor

I think the open issue will be better handled if I just switch to using mock_open. I'll put out a patch for that. Once that's in, you can pull out the mock.patch change and this should be good to go.

@PeterHamilton
Copy link
Contributor

Nevermind, I'm already using mock_open. The right solution is to scrap the code in the try block and just use the right module for Python 3+, builtins.

@PeterHamilton
Copy link
Contributor

See PR #239 for the open mock fix.

@PeterHamilton
Copy link
Contributor

PR #239 has been merged. Once this PR is updated, I'll merge it as well.

Fix unittests for compatibility between Python 2 and 3.
@cfs-pure
Copy link
Contributor Author

cfs-pure commented Jan 4, 2017

Removed my changes to test_server.py because of #239.

@PeterHamilton PeterHamilton merged commit bbc2d8e into OpenKMIP:master Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants