Example #1
0
    def test_trivial(self):
        import socket
        sock_class = socket.socket
        del socket

        saved_class = save_class(sock_class)
        restored_class = restore_class(saved_class)
        self.assertEqual(restored_class, sock_class)
Example #2
0
    def test_deep(self):
        from xml.sax.handler import ContentHandler
        ch_class = ContentHandler
        del ContentHandler

        saved_class = save_class(ch_class)
        restored_class = restore_class(saved_class)
        self.assertEqual(restored_class, ch_class)