summaryrefslogtreecommitdiff
path: root/service/test/unit/bitmask_libraries/test_certs.py
diff options
context:
space:
mode:
authorBruno Wagner <bwgpro@gmail.com>2015-06-08 18:27:09 -0300
committerBruno Wagner <bwgpro@gmail.com>2015-06-08 18:27:09 -0300
commit7b1af2ede753a63c9f584ccf37691917714e9655 (patch)
treebc40f8275a802e4072a9dc7a1679f83bf0ff7b6e /service/test/unit/bitmask_libraries/test_certs.py
parent8b0e4f05b142b73a5ca13f4706fcb6ececbb6911 (diff)
Fixed certificates initialization and removed which_api_bundle
Diffstat (limited to 'service/test/unit/bitmask_libraries/test_certs.py')
-rw-r--r--service/test/unit/bitmask_libraries/test_certs.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/service/test/unit/bitmask_libraries/test_certs.py b/service/test/unit/bitmask_libraries/test_certs.py
index 4a06649d..814f083f 100644
--- a/service/test/unit/bitmask_libraries/test_certs.py
+++ b/service/test/unit/bitmask_libraries/test_certs.py
@@ -1,6 +1,6 @@
import unittest
-from pixelated.bitmask_libraries.certs import which_bootstrap_CA_bundle, which_api_CA_bundle
+from pixelated.bitmask_libraries.certs import LeapCertificate
from pixelated.bitmask_libraries.config import AUTO_DETECT_CA_BUNDLE
from mock import MagicMock, patch
@@ -9,27 +9,25 @@ class CertsTest(unittest.TestCase):
@patch('pixelated.bitmask_libraries.certs.os.path.isfile')
@patch('pixelated.bitmask_libraries.certs.os.path.isdir')
- def test_that_which_bootstrap_cert_bundle_returns_byte_string(self, mock_isdir, mock_isfile):
+ def test_that_which_bootstrap_cert_bundle_returns_string(self, mock_isdir, mock_isfile):
mock_isfile.return_value = True
mock_isdir.return_value = True
config = MagicMock(bootstrap_ca_cert_bundle=AUTO_DETECT_CA_BUNDLE, leap_home='/leap/home')
provider = MagicMock(server_name=u'test.leap.net', config=config)
- bundle = which_bootstrap_CA_bundle(provider)
+ bundle = LeapCertificate(provider).auto_detect_bootstrap_ca_bundle()
self.assertEqual('/leap/home/providers/test.leap.net/test.leap.net.ca.crt', bundle)
- self.assertEqual(str, type(bundle))
@patch('pixelated.bitmask_libraries.certs.os.path.isfile')
@patch('pixelated.bitmask_libraries.certs.os.path.isdir')
- def test_that_which_bundle_returns_byte_string(self, mock_isdir, mock_isfile):
+ def test_that_which_bundle_returns_string(self, mock_isdir, mock_isfile):
mock_isfile.return_value = True
mock_isdir.return_value = True
config = MagicMock(bootstrap_ca_cert_bundle=AUTO_DETECT_CA_BUNDLE, ca_cert_bundle=None, leap_home='/some/leap/home')
provider = MagicMock(server_name=u'test.leap.net', config=config)
- bundle = which_api_CA_bundle(provider)
+ bundle = LeapCertificate(provider).api_ca_bundle()
self.assertEqual('/some/leap/home/providers/test.leap.net/keys/client/api.pem', bundle)
- self.assertEqual(str, type(bundle))