def test_synchronize_config_mirrorlist(self):
     product_id = self.makeFile(PRODUCT_ID, dirname=self.config_dir, basename="product.id")
     sysconf.set("product-id", product_id, soft=True)
     filename = self.makeFile(URPMI_CONFIG_MIRRORLIST, dirname=self.urpmi_dir, basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(sysconf.get("channels")["urpmisync-MirrorList"]["mirrorurl"],
                       "http://api.mandriva.com/mirrors/base.2010.1.x86_64.list")
 def test_synchronize_config_main(self):
     filename = self.makeFile(URPMI_CONFIG_MAIN,
                              dirname=self.urpmi_dir,
                              basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(
         sysconf.get("channels"), {
             "urpmisync-Main Updates": {
                 "type": "urpmi",
                 "name": "Main Updates",
                 "baseurl":
                 "ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/main/updates",
                 "hdlurl": "media_info/synthesis.hdlist.cz",
                 "disabled": False,
                 "removable": False,
                 "priority": 0
             },
             "urpmisync-Main": {
                 "type": "urpmi",
                 "name": "Main",
                 "baseurl":
                 "ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/main/release",
                 "hdlurl": "media_info/synthesis.hdlist.cz",
                 "disabled": False,
                 "removable": False,
                 "priority": 0
             },
         })
 def test_synchronize_config_variables(self):
     release = self.makeFile(RELEASE, dirname=self.config_dir, basename="release")
     sysconf.set("release", release, soft=True)
     filename = self.makeFile(URPMI_CONFIG_VARIABLES, dirname=self.urpmi_dir, basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(sysconf.get("channels")["urpmisync-Variables"]["mirrorurl"],
                       "2010.1/x86_64")
 def test_synchronize_config_variables(self):
     release = self.makeFile(RELEASE,
                             dirname=self.config_dir,
                             basename="release")
     sysconf.set("release", release, soft=True)
     filename = self.makeFile(URPMI_CONFIG_VARIABLES,
                              dirname=self.urpmi_dir,
                              basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(
         sysconf.get("channels")["urpmisync-Variables"]["mirrorurl"],
         "2010.1/x86_64")
 def test_synchronize_config_mirrorlist(self):
     product_id = self.makeFile(PRODUCT_ID,
                                dirname=self.config_dir,
                                basename="product.id")
     sysconf.set("product-id", product_id, soft=True)
     filename = self.makeFile(URPMI_CONFIG_MIRRORLIST,
                              dirname=self.urpmi_dir,
                              basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(
         sysconf.get("channels")["urpmisync-MirrorList"]["mirrorurl"],
         "http://api.mandriva.com/mirrors/base.2010.1.x86_64.list")
 def test_synchronize_config_cdrom(self):
     filename = self.makeFile(URPMI_CONFIG_CDROM, dirname=self.urpmi_dir, basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(sysconf.get("channels"), {
                       "urpmisync-Mandriva Linux - 2009.0 (Free) - Installer":
                           {"type": "urpmi",
                            "name": "Mandriva Linux - 2009.0 (Free) - Installer",
                            "baseurl": "localmedia://i586/media/main",
                            "hdlurl": "media_info/synthesis.hdlist.cz",
                            "disabled": True,
                            "removable": True,
                            "priority": 0},
                     })
 def test_synchronize_config_cdrom(self):
     filename = self.makeFile(URPMI_CONFIG_CDROM,
                              dirname=self.urpmi_dir,
                              basename="urpmi.cfg")
     syncURPMIChannels(filename, self.media_dir)
     self.assertEquals(
         sysconf.get("channels"), {
             "urpmisync-Mandriva Linux - 2009.0 (Free) - Installer": {
                 "type": "urpmi",
                 "name": "Mandriva Linux - 2009.0 (Free) - Installer",
                 "baseurl": "localmedia://i586/media/main",
                 "hdlurl": "media_info/synthesis.hdlist.cz",
                 "disabled": True,
                 "removable": True,
                 "priority": 0
             },
         })
    def test_synchronize_config_main(self):
        filename = self.makeFile(URPMI_CONFIG_MAIN, dirname=self.urpmi_dir, basename="urpmi.cfg")
        syncURPMIChannels(filename, self.media_dir)
        self.assertEquals(sysconf.get("channels"), {
                          "urpmisync-Main Updates":
                              {"type": "urpmi",
                               "name": "Main Updates",
                               "baseurl": "ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/main/updates",
                               "hdlurl": "media_info/synthesis.hdlist.cz",
                               "disabled": False,
                               "removable": False,
                               "priority": 0},

                          "urpmisync-Main":
                              {"type": "urpmi",
                               "name": "Main",
                               "baseurl": "ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/main/release",
                               "hdlurl": "media_info/synthesis.hdlist.cz",
                               "disabled": False,
                               "removable": False,
                               "priority": 0},
                        })