def test_WriteFingerprintAssertion_with_target_oem_props(self): target_info = BuildInfo(self.TEST_INFO_DICT_USES_OEM_PROPS, self.TEST_OEM_DICTS) source_info = BuildInfo(self.TEST_INFO_DICT, None) script_writer = MockScriptWriter() WriteFingerprintAssertion(script_writer, target_info, source_info) self.assertEqual([('AssertFingerprintOrThumbprint', 'build-fingerprint', 'build-thumbprint')], script_writer.script)
def test_WriteFingerprintAssertion_without_oem_props(self): target_info = BuildInfo(self.TEST_INFO_DICT, None) source_info_dict = copy.deepcopy(self.TEST_INFO_DICT) source_info_dict['build.prop']['ro.build.fingerprint'] = ( 'source-build-fingerprint') source_info = BuildInfo(source_info_dict, None) script_writer = MockScriptWriter() WriteFingerprintAssertion(script_writer, target_info, source_info) self.assertEqual([('AssertSomeFingerprint', 'source-build-fingerprint', 'build-fingerprint')], script_writer.script)
def test_WriteFingerprintAssertion_with_both_oem_props(self): target_info = BuildInfo(self.TEST_INFO_DICT_USES_OEM_PROPS, self.TEST_OEM_DICTS) source_info_dict = copy.deepcopy(self.TEST_INFO_DICT_USES_OEM_PROPS) source_info_dict['build.prop']['ro.build.thumbprint'] = ( 'source-build-thumbprint') source_info = BuildInfo(source_info_dict, self.TEST_OEM_DICTS) script_writer = MockScriptWriter() WriteFingerprintAssertion(script_writer, target_info, source_info) self.assertEqual([('AssertSomeThumbprint', 'build-thumbprint', 'source-build-thumbprint')], script_writer.script)