コード例 #1
0
ファイル: update_tests.py プロジェクト: 9kopb/droopescan
    def test_ss_hashes_get_signature(self):
        ss = Silverstripe()

        vf = MagicMock()
        ret_val = (self.gr, vf, ['3.1.3'])

        with patch('dscan.common.update_api.github_repo_new', return_value=ret_val, autospec=True) as m:
            with patch('dscan.common.update_api.hashes_get', autospec=True):
                ss.update_version()
コード例 #2
0
    def test_ss_calls_modules_get(self):
        ss = Silverstripe()
        o = mock_open()

        with patch('dscan.plugins.update.open', o, create=True):
            with patch('dscan.common.update_api.modules_get',
                       autospec=True) as p:
                self.updater.update_plugins(Silverstripe(), "Drupal")
                assert p.called
コード例 #3
0
    def test_ss_hashes_get_signature(self):
        ss = Silverstripe()

        vf = MagicMock()
        ret_val = (self.gr, vf, ['3.1.3'])

        with patch('dscan.common.update_api.github_repo_new',
                   return_value=ret_val,
                   autospec=True) as m:
            with patch('dscan.common.update_api.hashes_get', autospec=True):
                ss.update_version()
コード例 #4
0
    def test_ss_calls_modules_get_proper(self):
        self._mod_ss_modules_mock()

        ss = Silverstripe()
        o = mock_open()
        plugins, themes = ss.update_plugins()

        # verify removes duplicates.
        assert len(plugins) == 18
        # verifies package -> folder conversion.
        assert 'gridfieldextensions' in plugins
        assert len(themes) == 18
        assert 'gridfieldextensions' in themes
コード例 #5
0
ファイル: update_tests.py プロジェクト: 9kopb/droopescan
    def test_ss_calls_modules_get_proper(self):
        self._mod_ss_modules_mock()

        ss = Silverstripe()
        o = mock_open()
        plugins, themes = ss.update_plugins()

        # verify removes duplicates.
        assert len(plugins) == 18
        # verifies package -> folder conversion.
        assert 'gridfieldextensions' in plugins
        assert len(themes) == 18
        assert 'gridfieldextensions' in themes