Esempio n. 1
0
 def test_platform_pypy(self):
     with mock.platform_pyimp():
         with mock.sys_platform('darwin'):
             with mock.pypy_version((1, 4, 3)):
                 self.assertIn('PyPy', pyimplementation())
             with mock.pypy_version((1, 4, 3, 'a4')):
                 self.assertIn('PyPy', pyimplementation())
Esempio n. 2
0
 def test_platform_pypy(self):
     with mock.platform_pyimp():
         with mock.sys_platform('darwin'):
             with mock.pypy_version((1, 4, 3)):
                 self.assertIn('PyPy', pyimplementation())
             with mock.pypy_version((1, 4, 3, 'a4')):
                 self.assertIn('PyPy', pyimplementation())
Esempio n. 3
0
 def test_platform_fallback(self):
     with mock.platform_pyimp():
         with mock.sys_platform('darwin'):
             with mock.pypy_version():
                 self.assertEqual('CPython', pyimplementation())
Esempio n. 4
0
 def test_platform_jython(self):
     with mock.platform_pyimp():
         with mock.sys_platform('java 1.6.51'):
             self.assertIn('Jython', pyimplementation())
Esempio n. 5
0
 def test_platform_python_implementation(self):
     with mock.platform_pyimp(lambda: 'Xython'):
         self.assertEqual(pyimplementation(), 'Xython')
Esempio n. 6
0
 def test_platform_fallback(self):
     with mock.platform_pyimp():
         with mock.sys_platform('darwin'):
             with mock.pypy_version():
                 self.assertEqual('CPython', pyimplementation())
Esempio n. 7
0
 def test_platform_jython(self):
     with mock.platform_pyimp():
         with mock.sys_platform('java 1.6.51'):
             self.assertIn('Jython', pyimplementation())
Esempio n. 8
0
 def test_platform_python_implementation(self):
     with mock.platform_pyimp(lambda: 'Xython'):
         self.assertEqual(pyimplementation(), 'Xython')