def test_single_update(self, update): update.return_value = (1, 2) repo = MagicMock() repo.path = "/dev/null" args = MagicMock() args.plugin = "foo" self.assertEqual( list(bw_repo_plugin_update(repo, args)), ["foo: 1 → 2"], )
def test_all_update(self, update, listmethod): update.return_value = (1, 2) listmethod.return_value = (("foo", 1),) repo = MagicMock() repo.path = "/dev/null" args = MagicMock() args.plugin = None self.assertEqual( list(bw_repo_plugin_update(repo, args)), ["foo: 1 → 2"], )
def test_single_update(self, update): update.return_value = (1, 2) repo = MagicMock() repo.path = "/dev/null" args = { 'check_only': False, 'force': False, 'plugin': "foo", } self.assertEqual( list(bw_repo_plugin_update(repo, args)), ["foo: 1 → 2"], )
def test_all_update(self, update, listmethod): update.return_value = (1, 2) listmethod.return_value = (("foo", 1),) repo = MagicMock() repo.path = "/dev/null" args = { 'check_only': False, 'force': False, 'plugin': None, } self.assertEqual( list(bw_repo_plugin_update(repo, args)), ["foo: 1 → 2"], )