Package portage :: Package tests :: Package dep :: Module testExtendedAtomDict
[hide private]

Source Code for Module portage.tests.dep.testExtendedAtomDict

 1  # test_isvalidatom.py -- Portage Unit Testing Functionality 
 2  # Copyright 2006 Gentoo Foundation 
 3  # Distributed under the terms of the GNU General Public License v2 
 4   
 5  from portage.tests import TestCase 
 6  from portage.dep import ExtendedAtomDict 
 7   
8 -class TestExtendedAtomDict(TestCase):
9
10 - def testExtendedAtomDict(self):
11 d = ExtendedAtomDict(dict) 12 d["*/*"] = { "test1": "x" } 13 d["dev-libs/*"] = { "test2": "y" } 14 d.setdefault("sys-apps/portage", {})["test3"] = "z" 15 self.assertEqual(d.get("dev-libs/A"), { "test1": "x", "test2": "y" }) 16 self.assertEqual(d.get("sys-apps/portage"), { "test1": "x", "test3": "z" }) 17 self.assertEqual(d["dev-libs/*"], { "test2": "y" }) 18 self.assertEqual(d["sys-apps/portage"], {'test1': 'x', 'test3': 'z'})
19