Exemplo n.º 1
0
    def test_decrypt_exception(self):
        import pyconcrete
        print pyconcrete.__file__
        data = 'abc'
        self.assertLess(len(data), 16)

        with self.assertRaises(pyconcrete._pyconcrete.Error):
            pyconcrete.decrypt_buffer(data)
Exemplo n.º 2
0
 def test_decrypt_exception(self):
     import pyconcrete
     print(pyconcrete.__file__)
     data = 'abc'
     self.assertLess(len(data), 16)
     
     with self.assertRaises(pyconcrete._pyconcrete.Error):
         pyconcrete.decrypt_buffer(data)
Exemplo n.º 3
0
    def __do_encrypt_decrypt_file(self, py_code):
        py_filepath = self.lib_gen_py(py_code, 'test.py')
        pye_filepath = py_filepath + 'e'

        import pyconcrete
        pyconcrete.encrypt_file(py_filepath, pye_filepath)

        with open(pye_filepath, 'rb') as f:
            data = f.read()
        return pyconcrete.decrypt_buffer(data)
Exemplo n.º 4
0
 def __do_encrypt_decrypt_file(self, py_code):
     py_filepath = self.lib_gen_py(py_code, 'test.py')
     pye_filepath = py_filepath + 'e'
     
     import pyconcrete
     pyconcrete.encrypt_file(py_filepath, pye_filepath)
     
     with open(pye_filepath, 'rb') as f:
         data = f.read()
     return pyconcrete.decrypt_buffer(data)