manifest_fixer: rename to --prefer-code-integrity
During code review, the name change was suggested. Test: local CTS passed Bug: 112037137 Change-Id: I7eb25210afb45c7477b0d606574048a15c9c721d
This commit is contained in:
@@ -346,12 +346,12 @@ class AddUsesNonSdkApiTest(unittest.TestCase):
|
||||
self.assertEqual(output, expected)
|
||||
|
||||
|
||||
class PreferIntegrityTest(unittest.TestCase):
|
||||
"""Unit tests for add_prefer_integrity function."""
|
||||
class PreferCodeIntegrityTest(unittest.TestCase):
|
||||
"""Unit tests for add_prefer_code_integrity function."""
|
||||
|
||||
def run_test(self, input_manifest):
|
||||
doc = minidom.parseString(input_manifest)
|
||||
manifest_fixer.add_prefer_integrity(doc)
|
||||
manifest_fixer.add_prefer_code_integrity(doc)
|
||||
output = StringIO.StringIO()
|
||||
manifest_fixer.write_xml(output, doc)
|
||||
return output.getvalue()
|
||||
@@ -362,23 +362,23 @@ class PreferIntegrityTest(unittest.TestCase):
|
||||
' <application%s/>\n'
|
||||
'</manifest>\n')
|
||||
|
||||
def prefer_integrity(self, value):
|
||||
return ' android:preferIntegrity="%s"' % value
|
||||
def prefer_code_integrity(self, value):
|
||||
return ' android:preferCodeIntegrity="%s"' % value
|
||||
|
||||
def test_manifest_with_undeclared_preference(self):
|
||||
manifest_input = self.manifest_tmpl % ''
|
||||
expected = self.manifest_tmpl % self.prefer_integrity('true')
|
||||
expected = self.manifest_tmpl % self.prefer_code_integrity('true')
|
||||
output = self.run_test(manifest_input)
|
||||
self.assertEqual(output, expected)
|
||||
|
||||
def test_manifest_with_prefer_integrity(self):
|
||||
manifest_input = self.manifest_tmpl % self.prefer_integrity('true')
|
||||
def test_manifest_with_prefer_code_integrity(self):
|
||||
manifest_input = self.manifest_tmpl % self.prefer_code_integrity('true')
|
||||
expected = manifest_input
|
||||
output = self.run_test(manifest_input)
|
||||
self.assertEqual(output, expected)
|
||||
|
||||
def test_manifest_with_not_prefer_integrity(self):
|
||||
manifest_input = self.manifest_tmpl % self.prefer_integrity('false')
|
||||
def test_manifest_with_not_prefer_code_integrity(self):
|
||||
manifest_input = self.manifest_tmpl % self.prefer_code_integrity('false')
|
||||
self.assertRaises(RuntimeError, self.run_test, manifest_input)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user