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()
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
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