示例#1
0
 def test_get_architecture_from_platform_for_x86(self):
     for platform_architecture, node_arch in [("32bit", "x86"),
                                              ("64bit", "x64")]:
         self.useFixture(
             fixtures.MockPatch("platform.machine", return_value="x86_64"))
         self.useFixture(
             fixtures.MockPatch("platform.architecture",
                                return_value=("64bit", "ELF")))
         self.expectThat(NpmPlugin._get_architecture(), Equals("x64"))
示例#2
0
 def test_get_architecture_from_snap_arch(self):
     for snap_arch, node_arch in [
         ("amd64", "x64"),
         ("i386", "x86"),
         ("armhf", "armv7l"),
         ("arm64", "arm64"),
         ("ppc64el", "ppc64le"),
         ("s390x", "s390x"),
     ]:
         self.useFixture(
             fixtures.EnvironmentVariable("SNAP_ARCH", snap_arch))
         self.expectThat(NpmPlugin._get_architecture(), Equals(node_arch))