Esempio n. 1
0
 def test_retrieve_ca_cert_no_file(self, _isfile):
     _isfile.return_value = False
     with patch_open() as (_open, _file):
         self.assertEqual(apache_utils.retrieve_ca_cert('mycertfile'), None)
         self.assertFalse(_open.called)
Esempio n. 2
0
 def test_retrieve_ca_cert(self, _isfile):
     _isfile.return_value = True
     with patch_open() as (_open, _file):
         _file.read.return_value = cert
         self.assertEqual(apache_utils.retrieve_ca_cert('mycertfile'), cert)
         _open.assert_called_once_with('mycertfile', 'rb')