Example #1
0
 def _getURL(self, filename="", component=None, subpath=False):
     if self._arch is None:
         self._arch = getArchitecture()
     if subpath:
         distrourl = ""
     elif not self._comps:
         distrourl = posixpath.join(self._baseurl, self._distro)
     else:
         distrourl = posixpath.join(self._baseurl, "dists", self._distro)
     if component:
         return posixpath.join(distrourl, component, "binary-" + self._arch, filename)
     else:
         return posixpath.join(distrourl, filename)
 def test_get_architecture_with_i86pc_sunos5(self):
     self.set_arch_and_platform("i86pc", "sunos5")
     self.assertEquals(getArchitecture(), "solaris-i386")
 def test_get_architecture_with_i386_darwin(self):
     self.set_arch_and_platform("i386", "darwin")
     self.assertEquals(getArchitecture(), "darwin-i386")
 def test_get_architecture_with_i86pc_anything(self):
     self.set_arch_and_platform("i86pc", "anything")
     self.assertEquals(getArchitecture(), "anything-i386")
 def test_get_architecture_with_arm_linux2(self):
     self.set_arch_and_platform("arm", "linux2")
     def fake_arm_eabi(): return True
     smart.backends.deb._base.arm_eabi = fake_arm_eabi
     self.assertEquals(getArchitecture(), "armel")
 def test_get_architecture_with_i686_linux2(self):
     self.set_arch_and_platform("i686", "linux2")
     self.assertEquals(getArchitecture(), "i386")