コード例 #1
0
class TestPythonInfo(unittest.TestCase):
    def setUp(self):
        self.python_info = PythonInfo()

    @mock.patch('xcrawler.pythonutils.info.python_info.version_info')
    def test_is_python2(self, mock_version_info):
        mock_version_info.major = 2
        result = self.python_info.is_python2()
        self.assertEquals(result, True)

    @mock.patch('xcrawler.pythonutils.info.python_info.version_info')
    def test_is_python3(self, mock_version_info):
        mock_version_info.major = 3
        result = self.python_info.is_python3()
        self.assertEquals(result, True)
コード例 #2
0
ファイル: test_python_info.py プロジェクト: cardsurf/xcrawler
class TestPythonInfo(unittest.TestCase):

    def setUp(self):
        self.python_info = PythonInfo()

    @mock.patch('xcrawler.pythonutils.info.python_info.version_info')
    def test_is_python2(self, mock_version_info):
        mock_version_info.major = 2
        result = self.python_info.is_python2()
        self.assertEquals(result, True)

    @mock.patch('xcrawler.pythonutils.info.python_info.version_info')
    def test_is_python3(self, mock_version_info):
        mock_version_info.major = 3
        result = self.python_info.is_python3()
        self.assertEquals(result, True)
コード例 #3
0
 def __init__(self, python_info=PythonInfo()):
     self.python_info = python_info
コード例 #4
0
ファイル: test_python_info.py プロジェクト: cardsurf/xcrawler
 def setUp(self):
     self.python_info = PythonInfo()
コード例 #5
0
 def setUp(self):
     self.python_info = PythonInfo()