def test_22_to_string(self):
        "test to_string() method"
        pa = CryptPolicy(**self.sample_config_5pd)
        s = pa.to_string() #NOTE: can't compare string directly, ordering etc may not match
        pb = CryptPolicy.from_string(s)
        self.assertEqual(pb.to_dict(), self.sample_config_5pd)

        s = pa.to_string(encoding="latin-1")
        self.assertIsInstance(s, bytes)
Esempio n. 2
0
    def test_22_to_string(self):
        """test to_string() method"""
        pa = CryptPolicy(**self.sample_config_5pd)
        s = pa.to_string() # NOTE: can't compare string directly, ordering etc may not match
        pb = CryptPolicy.from_string(s)
        self.assertEqual(pb.to_dict(), self.sample_config_5pd)

        s = pa.to_string(encoding="latin-1")
        self.assertIsInstance(s, bytes)
Esempio n. 3
0
 def test_22_to_string(self):
     "test to_string() method"
     pa = CryptPolicy(**self.sample_config_5pd)
     s = pa.to_string() #NOTE: can't compare string directly, ordering etc may not match
     pb = CryptPolicy.from_string(s)
     self.assertEqual(pb.to_dict(), self.sample_config_5pd)