From 32282d6a5105ebcd0f5ed0229803ec194025f6d6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 23 Oct 2011 15:15:34 -0700 Subject: [PATCH] test bug #388187 --- .../tests/emerge/test_global_updates.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pym/portage/tests/emerge/test_global_updates.py diff --git a/pym/portage/tests/emerge/test_global_updates.py b/pym/portage/tests/emerge/test_global_updates.py new file mode 100644 index 000000000..add4590e5 --- /dev/null +++ b/pym/portage/tests/emerge/test_global_updates.py @@ -0,0 +1,37 @@ +# Copyright 2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.update import parse_updates +from portage.dep import Atom + +class ParseUpdatesTestCase(TestCase): + + def testParseUpdates(self): + test_cases = ( + ( + """ +slotmove invalid_atom 0 3 +slotmove !=invalid/blocker-3* 0 3 +slotmove =valid/atom-3* 0 3 invalid_extra_token +slotmove =valid/atom-3* 0 3 +move valid/atom1 valid/atom2 invalid_extra_token +move valid/atom1 invalid_atom2 +move invalid_atom1 valid/atom2 +move !invalid/blocker1 valid/atom2 +move valid/atom1 !invalid/blocker2 +move valid/atom1 valid/atom2 +""", + [ + ['slotmove', Atom('=valid/atom-3*'), '0', '3'], + ['move', 'valid/atom1', 'valid/atom2'], + ], + 8, + ), + + ) + + for input_content, expected_output, expected_error_count in test_cases: + output_data, errors = parse_updates(input_content) + self.assertEqual(output_data, expected_output) + self.assertEqual(len(errors), expected_error_count) -- 2.26.2