예제 #1
0
 def testDoesNotDuplicatePermission(self):
     self.assertHasPermission(
         Stubify(MANIFEST_WITH_PERMISSION)[0], READ_EXTERNAL_STORAGE)
예제 #2
0
 def testBadManifest(self):
     with self.assertRaises(BadManifestException):
         Stubify(BAD_MANIFEST)
예제 #3
0
 def testAddsPermission(self):
     self.assertHasPermission(
         Stubify(MANIFEST_WITH_APPLICATION)[0], READ_EXTERNAL_STORAGE)
예제 #4
0
 def testAddsNewAplication(self):
     new_manifest, old_application, app_pkg = (
         Stubify(MANIFEST_WITHOUT_APPLICATION))
     self.assertEqual("com.google.package", app_pkg)
     self.assertEqual("android.app.Application", old_application)
     self.assertEqual(STUB_APPLICATION, self.GetApplication(new_manifest))
예제 #5
0
 def testReplacesOldApplication(self):
     new_manifest, old_application, app_pkg = Stubify(
         MANIFEST_WITH_APPLICATION)
     self.assertEqual("com.google.package", app_pkg)
     self.assertEqual("old.application", old_application)
     self.assertEqual(STUB_APPLICATION, self.GetApplication(new_manifest))
예제 #6
0
 def testTooManyApplications(self):
     with self.assertRaises(BadManifestException):
         Stubify(MULTIPLE_APPLICATIONS)
예제 #7
0
 def testRemovesHasCode(self):
   new_manifest, _, _ = Stubify(MANIFEST_WITH_HASCODE)
   application = ElementTree.fromstring(new_manifest).find("application")
   self.assertFalse(("{%s}hasCode" % ANDROID) in application.attrib)