diff options
author | Folker Bernitt and Victor Shyba <pixelated-team+fbernitt+vshyba@thoughtworks.com> | 2015-03-31 11:58:23 -0300 |
---|---|---|
committer | Patrick Maia <pmaia@thoughtworks.com> | 2015-03-31 12:01:29 -0300 |
commit | 46ea4c16a78b0dcb18ccdd301c164963150204a4 (patch) | |
tree | b124257c2c584c6c4a1f1758d4431a39c3f85380 /service/test/unit | |
parent | b998b240868ee4d6d30c86397793c9d194d4501b (diff) |
Better naming for which_bundle functions
-- Issues #93 and #333
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/bitmask_libraries/test_certs.py | 10 | ||||
-rw-r--r-- | service/test/unit/bitmask_libraries/test_provider.py | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/service/test/unit/bitmask_libraries/test_certs.py b/service/test/unit/bitmask_libraries/test_certs.py index 3683f9ae..ba56d5c2 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_bundle, which_bundle +from pixelated.bitmask_libraries.certs import which_bootstrap_CA_bundle, which_api_CA_bundle from pixelated.bitmask_libraries.config import AUTO_DETECT_CA_BUNDLE from mock import MagicMock, patch @@ -9,13 +9,13 @@ 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_bundle_returns_byte_string(self, mock_isdir, mock_isfile): + def test_that_which_bootstrap_cert_bundle_returns_byte_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, certs_home='/some/path') provider = MagicMock(server_name=u'test.leap.net', config=config) - bundle = which_bootstrap_bundle(provider) + bundle = which_bootstrap_CA_bundle(provider) self.assertEqual('/some/path/test.leap.net.ca.crt', bundle) self.assertEqual(str, type(bundle)) @@ -29,7 +29,7 @@ class CertsTest(unittest.TestCase): config = MagicMock(bootstrap_ca_cert_bundle=AUTO_DETECT_CA_BUNDLE, ca_cert_bundle=None, leap_home='/some/leap/home', certs_home='/some/path') provider = MagicMock(server_name=u'test.leap.net', config=config) - bundle = which_bundle(provider) + bundle = which_api_CA_bundle(provider) - self.assertEqual('/some/leap/home/providers/test.leap.net/keys/client/provider.pem', bundle) + self.assertEqual('/some/leap/home/providers/test.leap.net/keys/client/api.pem', bundle) self.assertEqual(str, type(bundle)) diff --git a/service/test/unit/bitmask_libraries/test_provider.py b/service/test/unit/bitmask_libraries/test_provider.py index a1e69543..0771c7cc 100644 --- a/service/test/unit/bitmask_libraries/test_provider.py +++ b/service/test/unit/bitmask_libraries/test_provider.py @@ -219,8 +219,8 @@ class LeapProviderTest(AbstractLeapTest): session = MagicMock(wraps=requests.session()) session_func = MagicMock(return_value=session) - with patch('pixelated.bitmask_libraries.provider.which_bootstrap_fingerprint', return_value='some fingerprint'): - with patch('pixelated.bitmask_libraries.provider.which_bootstrap_bundle', return_value=False): + with patch('pixelated.bitmask_libraries.provider.which_bootstrap_cert_fingerprint', return_value='some fingerprint'): + with patch('pixelated.bitmask_libraries.provider.which_bootstrap_CA_bundle', return_value=False): with patch('pixelated.bitmask_libraries.provider.requests.session', new=session_func): with HTTMock(provider_json_mock, ca_cert_mock, not_found_mock): provider = LeapProvider('some-provider.test', self.config) |