From: Zac Medico Date: Sun, 23 Oct 2011 22:15:34 +0000 (-0700) Subject: test bug #388187 X-Git-Tag: v2.2.0_alpha71~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32282d6a5105ebcd0f5ed0229803ec194025f6d6;p=portage.git test bug #388187 --- 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)