def test_create_meta(self): dest_short_paths = ["dest/path/1", "dest/path/2", "dest/path/3"] package_installer = PackageInstaller("prefix", {self.dist: {"icon": "icon"}}, self.dist) package_installer.package_info = self.package_info package_installer.extracted_package_dir = "extracted_package_dir" output = package_installer._create_meta(dest_short_paths, LinkType.directory, "http://test.url") expected_output = Record(icon="icon", icondata="icondata", build=0, build_number=0, name="test_foo", version=0, url="http://test.url", files=dest_short_paths, link=Link(source="extracted_package_dir", type=LinkType.directory)) self.assertEquals(output, expected_output)
def test_make_link_operation(self): package_installer = PackageInstaller("prefix", {}, self.dist) package_installer.package_info = self.package_info output = package_installer._make_link_operations(LinkType.hard_link) expected_output = tuple([LinkOperation("test/path/1", "test/path/1", LinkType.copy, "/opt/anaconda1anaconda2anaconda3", FileMode.text, False), LinkOperation("test/path/2", "test/path/2", LinkType.copy, "", None, False), LinkOperation("test/path/3", "test/path/3", LinkType.copy, "", None, False), LinkOperation("menu/test.json", "menu/test.json", LinkType.hard_link, "", None, True)]) self.assertEquals(output, expected_output)
def test_make_link_operation(self): package_installer = PackageInstaller("prefix", {}, self.dist) package_installer.package_info = self.package_info output = package_installer._make_link_operations(LinkType.hardlink) expected_output = tuple([LinkOperation("test/path/1", "test/path/1", LinkType.copy, "/opt/anaconda1anaconda2anaconda3", FileMode.text, False), LinkOperation("test/path/2", "test/path/2", LinkType.copy, "", None, False), LinkOperation("test/path/3", "test/path/3", LinkType.copy, "", None, False), LinkOperation("menu/test.json", "menu/test.json", LinkType.hardlink, "", None, True)]) self.assertEquals(output, expected_output)
def test_create_meta(self): dest_short_paths = ["dest/path/1", "dest/path/2", "dest/path/3"] package_installer = PackageInstaller("prefix", {self.dist: {"icon": "icon"}}, self.dist) package_installer.package_info = self.package_info package_installer.extracted_package_dir = "extracted_package_dir" output = package_installer._create_meta(dest_short_paths, LinkType.directory, "http://test.url") expected_output = {"key": "value", "icon": "icon", "url": "http://test.url", "files": dest_short_paths, "link": Link(source="extracted_package_dir", type=LinkType.directory), "icondata": "icondata" } self.assertEquals(output, expected_output)
def test_create_meta(self): dest_short_paths = ["dest/path/1", "dest/path/2", "dest/path/3"] package_installer = PackageInstaller("prefix", {self.dist: { "icon": "icon" }}, self.dist) package_installer.package_info = self.package_info package_installer.extracted_package_dir = "extracted_package_dir" output = package_installer._create_meta(dest_short_paths, LinkType.directory, "http://test.url") expected_output = { "key": "value", "icon": "icon", "url": "http://test.url", "files": dest_short_paths, "link": Link(source="extracted_package_dir", type=LinkType.directory), "icondata": "icondata" } self.assertEquals(output, expected_output)