def test_update(self): environment = Environment("env1") packages_1 = Packages(environment, ["pkg_1", "pkg_2"]) packages_2 = Packages(environment, ["pkg_3", "pkg_4"]) packages_1.update(packages_2) self.assertEquals(['pkg_1', 'pkg_2', 'pkg_3', 'pkg_4'], packages_1.packages("env1"))
def test_packages(self): environment = Environment("env1") packages = Packages(environment, ["pkg_1", "pkg_2"]) packages.update({Environment("env2") : []}) self.assertEquals(["pkg_1", "pkg_2"], packages.packages(environment)) self.assertEquals(["pkg_1", "pkg_2"], packages.packages("env1"))
def test_init(self): environment = Environment("env") packages = Packages(environment, ["pkg_1", "pkg_2"]) self.assertEquals(environment, packages.keys()[0]) self.assertEquals(["pkg_1", "pkg_2"], packages.values()[0])
def test_getitem(self): environment = Environment("env1") packages = Packages(environment, ["pkg_1", "pkg_2"]) self.assertEquals(["pkg_1", "pkg_2"], packages[Environment("env1")])
def test_packages(self): environment = Environment("env1") packages = Packages(environment, ["pkg_1", "pkg_2"]) packages.update({Environment("env2"): []}) self.assertEquals(["pkg_1", "pkg_2"], packages.packages(environment)) self.assertEquals(["pkg_1", "pkg_2"], packages.packages("env1"))