コード例 #1
0
 def testAddsNewAplication(self):
   new_manifest, old_application, app_pkg = (
       StubifyMobileInstall(MANIFEST_WITHOUT_APPLICATION))
   self.assertEqual("com.google.package", app_pkg)
   self.assertEqual("android.app.Application", old_application)
   self.assertEqual(
       MOBILE_INSTALL_STUB_APPLICATION, self.GetApplication(new_manifest))
コード例 #2
0
 def testReplacesOldApplication(self):
   new_manifest, old_application, app_pkg = StubifyMobileInstall(
       MANIFEST_WITH_APPLICATION)
   self.assertEqual("com.google.package", app_pkg)
   self.assertEqual("old.application", old_application)
   self.assertEqual(
       MOBILE_INSTALL_STUB_APPLICATION, self.GetApplication(new_manifest))
コード例 #3
0
 def testTooManyApplications(self):
   with self.assertRaises(BadManifestException):
     StubifyMobileInstall(MULTIPLE_APPLICATIONS)
コード例 #4
0
 def testBadManifest(self):
   with self.assertRaises(BadManifestException):
     StubifyMobileInstall(BAD_MANIFEST)
コード例 #5
0
 def testDoesNotDuplicatePermission(self):
   self.assertHasPermission(
       StubifyMobileInstall(
           MANIFEST_WITH_PERMISSION)[0], READ_EXTERNAL_STORAGE)
コード例 #6
0
 def testAddsPermission(self):
   self.assertHasPermission(
       StubifyMobileInstall(
           MANIFEST_WITH_APPLICATION)[0], READ_EXTERNAL_STORAGE)
コード例 #7
0
 def testRemovesHasCode(self):
   new_manifest, _, _ = StubifyMobileInstall(MANIFEST_WITH_HASCODE)
   application = ElementTree.fromstring(new_manifest).find("application")
   self.assertFalse(("{%s}hasCode" % ANDROID) in application.attrib)
コード例 #8
0
ファイル: stubify_manifest_test.py プロジェクト: xjc90s/bazel
 def testNoPackageInManifest(self):
     with self.assertRaises(BadManifestException):
         StubifyMobileInstall(NO_PACKAGE_MANIFEST)