Ejemplo n.º 1
0
 def _get_web_client(self):
     baseurl = self._get_config("url")
     assert baseurl, ("Cannot perform synchronization "
                     "without url configuration.")
     username = self._get_config("username")
     password = self._get_config("password")
     if password:
         try:
             password = str_unmask(password)
         except ValueError:
             # assume its in clear text
             pass
     return WebClient(baseurl, username, password, debug=False)
Ejemplo n.º 2
0
 def test_mask(self):
     message = "Hello World!"
     masked = str_mask(message)
     self.assertEqual(message, str_unmask(masked))
     self.assertRaises(ValueError, str_unmask, "clear text")