コード例 #1
0
ファイル: test_os_wait.py プロジェクト: zielmicha/pypy
 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')
コード例 #2
0
ファイル: test_os_wait.py プロジェクト: charred/pypy
 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')
コード例 #3
0
ファイル: test_md5_extra.py プロジェクト: Darriall/pypy
 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))
コード例 #4
0
ファイル: test_md5_extra.py プロジェクト: sota/pypy-old
 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))
コード例 #5
0
 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))
コード例 #6
0
ファイル: test_md5_extra.py プロジェクト: Qointum/pypy
 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))
コード例 #7
0
ファイル: test_md5_extra.py プロジェクト: Qointum/pypy
    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
コード例 #8
0
ファイル: test_md5_extra.py プロジェクト: sota/pypy-old
    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
コード例 #9
0
    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
コード例 #10
0
ファイル: test_resource.py プロジェクト: charred/pypy
 def setup_class(cls):
     rebuild.rebuild_one('resource.ctc.py')
     cls.w_resource = import_lib_pypy(cls.space, 'resource',
                                      'No resource module available')
コード例 #11
0
 def setup_class(cls):
     cls.w__sha = import_lib_pypy(cls.space, '_sha1')
コード例 #12
0
ファイル: test_collections.py プロジェクト: Darriall/pypy
 def setup_class(cls):
     cls.w_collections = import_lib_pypy(cls.space, '_collections')
コード例 #13
0
ファイル: test_collections.py プロジェクト: Darriall/pypy
 def setup_class(cls):
     space = cls.space
     cls.w_collections = import_lib_pypy(space, '_collections')
     cls.w_n = space.wrap(10)
コード例 #14
0
ファイル: test_grp_extra.py プロジェクト: Qointum/pypy
 def setup_class(cls):
     cls.w_grp = import_lib_pypy(cls.space, 'grp',
                                 "No grp module on this platform")
コード例 #15
0
 def setup_class(cls):
     cls.w_grp = import_lib_pypy(cls.space, 'grp',
                                 "No grp module on this platform")
コード例 #16
0
 def setup_class(cls):
     space = cls.space
     #cls.w___pypy__ = import_lib_pypy(space, '__pypy__')
     cls.w_datetime = import_lib_pypy(space, 'datetime')
コード例 #17
0
 def setup_class(cls):
     rebuild.rebuild_one('resource.ctc.py')
     cls.w_resource = import_lib_pypy(cls.space, 'resource',
                                      'No resource module available')
コード例 #18
0
ファイル: test_sha_extra.py プロジェクト: Darriall/pypy
 def setup_class(cls):
     cls.w__sha = import_lib_pypy(cls.space, '_sha')
コード例 #19
0
 def setup_class(cls):
     cls.w_collections = import_lib_pypy(cls.space, '_collections')
コード例 #20
0
 def setup_class(cls):
     space = cls.space
     cls.w_collections = import_lib_pypy(space, '_collections')
     cls.w_n = space.wrap(10)
コード例 #21
0
ファイル: test_structseq.py プロジェクト: Qointum/pypy
 def setup_class(cls):
     cls.w__structseq = import_lib_pypy(cls.space, '_structseq')
コード例 #22
0
ファイル: test_structseq.py プロジェクト: Mu-L/pypy
 def setup_class(cls):
     cls.w__structseq = import_lib_pypy(cls.space, '_structseq')