Beispiel #1
0
    def test_tuples_become_lists(self):
        p = YAMLProtocol()
        safe_p = SafeYAMLProtocol()

        self.assertEqual(p.read(safe_p.write((), ())), ([], []))
        self.assertRaises(
            ConstructorError, safe_p.read, p.write((), ()))
Beispiel #2
0
    def test_protocol_wont_decode(self):
        p = YAMLProtocol()
        safe_p = SafeYAMLProtocol()

        for key, value in UNSAFE_KEY_VALUES:
            encoded = p.write(key, value)
            self.assertRaises(ConstructorError, safe_p.read, encoded)