diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-11-10 14:11:21 +0100 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-11-10 14:51:22 +0100 |
commit | 5c9aa9aff7fed5feddc58845c72607caa7feb76c (patch) | |
tree | 5e07dc2bd75ecc602f46653f029b9ca7694c2485 | |
parent | af14953231cf1f240863acb588fedd8d86b2ce74 (diff) |
Added test for bundle detection return type.
-rw-r--r-- | service/test/unit/bitmask_libraries/certs_test.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/service/test/unit/bitmask_libraries/certs_test.py b/service/test/unit/bitmask_libraries/certs_test.py new file mode 100644 index 00000000..405cc4db --- /dev/null +++ b/service/test/unit/bitmask_libraries/certs_test.py @@ -0,0 +1,19 @@ +import unittest + +from pixelated.bitmask_libraries.certs import which_bundle +from pixelated.bitmask_libraries.config import AUTO_DETECT_CA_BUNDLE +from mock import MagicMock, patch + + +class CertsTest(unittest.TestCase): + + @patch('pixelated.bitmask_libraries.certs.os.path.isfile') + def test_that_which_bundle_returns_byte_string(self, mock_isfile): + mock_isfile.return_value = True + config = MagicMock(ca_cert_bundle=AUTO_DETECT_CA_BUNDLE, certs_home='/some/path') + provider = MagicMock(server_name='test.leap.net', config=config) + + bundle = which_bundle(provider) + + self.assertEqual('/some/path/test.leap.net.ca.crt', bundle) + self.assertEqual(str, type(bundle)) |