def setup_class(cls): if not hasattr(os, "fork"): py.test.skip("Need fork() to test wait3/wait4()") rebuild.rebuild_one('resource.ctc.py') cls.w__pypy_wait = import_lib_pypy( cls.space, '_pypy_wait', '_pypy_wait not supported on this platform')
def setup_class(cls): from pypy.interpreter import gateway space = cls.space cls.w__md5 = import_lib_pypy(space, '_md5') if cls.runappdirect: # interp2app doesn't work in appdirect mode cls.w_compare_host = staticmethod(compare_host) else: compare_host.unwrap_spec = [str, str, str] cls.w_compare_host = space.wrap(gateway.interp2app(compare_host))
def setup_class(cls): from pypy.interpreter import gateway space = cls.space cls.w__md5 = import_lib_pypy(space, '_md5') if cls.runappdirect: # XXX: import py py.test.skip('Unavailable under py3 runappdirect') else: compare_host.unwrap_spec = ['bytes', 'bytes', 'text'] cls.w_compare_host = space.wrap(gateway.interp2app(compare_host))
def setup_class(cls): from pypy.interpreter import gateway space = cls.space cls.w__md5 = import_lib_pypy(space, '_md5') if cls.runappdirect: # XXX: import py py.test.skip('Unavailable under py3 runappdirect') else: compare_host.unwrap_spec = [str, str, str] cls.w_compare_host = space.wrap(gateway.interp2app(compare_host))
def test_update(self): """Test updating cloned objects.""" cases = ( "123", "1234", "12345", "123456", "1234567", "12345678", "123456789 123456789 123456789 ", "123456789 123456789 ", "123456789 123456789 1", "123456789 123456789 12", "123456789 123456789 123", "123456789 123456789 1234", "123456789 123456789 123456789 1", "123456789 123456789 123456789 12", "123456789 123456789 123456789 123", "123456789 123456789 123456789 1234", "123456789 123456789 123456789 12345", "123456789 123456789 123456789 123456", "123456789 123456789 123456789 1234567", "123456789 123456789 123456789 12345678", ) space = self.space w__md5 = import_lib_pypy(space, '_md5') # Load both with same prefix. prefix1 = 2**10 * 'a' # The host md5 m1 = md5.md5() m1.update(prefix1) m1c = m1.copy() # The app-level _md5 w_m2 = space.call_method(w__md5, 'md5') space.call_method(w_m2, 'update', space.wrap(prefix1)) w_m2c = space.call_method(w_m2, 'copy') # Update and compare... for i in range(len(cases)): message = cases[i][0] m1c.update(message) d1 = m1c.hexdigest() space.call_method(w_m2c, 'update', space.wrap(message)) w_d2 = space.call_method(w_m2c, 'hexdigest') d2 = space.str_w(w_d2) assert d1 == d2
def test_update(self): """Test updating cloned objects.""" cases = ( "123", "1234", "12345", "123456", "1234567", "12345678", "123456789 123456789 123456789 ", "123456789 123456789 ", "123456789 123456789 1", "123456789 123456789 12", "123456789 123456789 123", "123456789 123456789 1234", "123456789 123456789 123456789 1", "123456789 123456789 123456789 12", "123456789 123456789 123456789 123", "123456789 123456789 123456789 1234", "123456789 123456789 123456789 12345", "123456789 123456789 123456789 123456", "123456789 123456789 123456789 1234567", "123456789 123456789 123456789 12345678", ) space = self.space w__md5 = import_lib_pypy(space, '_md5') # Load both with same prefix. prefix1 = 2**10 * 'a' # The host md5 m1 = md5.md5() m1.update(prefix1) m1c = m1.copy() # The app-level _md5 w_m2 = space.call_method(w__md5, 'new') space.call_method(w_m2, 'update', space.wrap(prefix1)) w_m2c = space.call_method(w_m2, 'copy') # Update and compare... for i in range(len(cases)): message = cases[i][0] m1c.update(message) d1 = m1c.hexdigest() space.call_method(w_m2c, 'update', space.wrap(message)) w_d2 = space.call_method(w_m2c, 'hexdigest') d2 = space.str_w(w_d2) assert d1 == d2
def test_update(self): """Test updating cloned objects.""" cases = ( b"123", b"1234", b"12345", b"123456", b"1234567", b"12345678", b"123456789 123456789 123456789 ", b"123456789 123456789 ", b"123456789 123456789 1", b"123456789 123456789 12", b"123456789 123456789 123", b"123456789 123456789 1234", b"123456789 123456789 123456789 1", b"123456789 123456789 123456789 12", b"123456789 123456789 123456789 123", b"123456789 123456789 123456789 1234", b"123456789 123456789 123456789 12345", b"123456789 123456789 123456789 123456", b"123456789 123456789 123456789 1234567", b"123456789 123456789 123456789 12345678", ) space = self.space w__md5 = import_lib_pypy(space, '_md5') # Load both with same prefix. prefix1 = 2**10 * b'a' # The host md5 m1 = md5.md5() m1.update(prefix1) m1c = m1.copy() # The app-level _md5 w_m2 = space.call_method(w__md5, 'md5') space.call_method(w_m2, 'update', space.newbytes(prefix1)) w_m2c = space.call_method(w_m2, 'copy') # Update and compare... for message in cases: m1c.update(message) d1 = m1c.hexdigest() space.call_method(w_m2c, 'update', space.newbytes(message)) w_d2 = space.call_method(w_m2c, 'hexdigest') d2 = space.text_w(w_d2) assert d1 == d2
def setup_class(cls): rebuild.rebuild_one('resource.ctc.py') cls.w_resource = import_lib_pypy(cls.space, 'resource', 'No resource module available')
def setup_class(cls): cls.w__sha = import_lib_pypy(cls.space, '_sha1')
def setup_class(cls): cls.w_collections = import_lib_pypy(cls.space, '_collections')
def setup_class(cls): space = cls.space cls.w_collections = import_lib_pypy(space, '_collections') cls.w_n = space.wrap(10)
def setup_class(cls): cls.w_grp = import_lib_pypy(cls.space, 'grp', "No grp module on this platform")
def setup_class(cls): space = cls.space #cls.w___pypy__ = import_lib_pypy(space, '__pypy__') cls.w_datetime = import_lib_pypy(space, 'datetime')
def setup_class(cls): cls.w__sha = import_lib_pypy(cls.space, '_sha')
def setup_class(cls): cls.w__structseq = import_lib_pypy(cls.space, '_structseq')