コード例 #1
0
    def test_WriteFingerprintAssertion_with_target_oem_props(self):
        target_info = common.BuildInfo(self.TEST_INFO_DICT_USES_OEM_PROPS,
                                       self.TEST_OEM_DICTS)
        source_info = common.BuildInfo(self.TEST_TARGET_INFO_DICT, None)

        script_writer = test_utils.MockScriptWriter()
        WriteFingerprintAssertion(script_writer, target_info, source_info)
        self.assertEqual([('AssertFingerprintOrThumbprint',
                           'build-fingerprint-target', 'build-thumbprint')],
                         script_writer.lines)
コード例 #2
0
    def test_WriteFingerprintAssertion_without_oem_props(self):
        target_info = common.BuildInfo(self.TEST_TARGET_INFO_DICT, None)
        source_info_dict = copy.deepcopy(self.TEST_TARGET_INFO_DICT)
        source_info_dict['build.prop'].build_props['ro.build.fingerprint'] = (
            'source-build-fingerprint')
        source_info = common.BuildInfo(source_info_dict, None)

        script_writer = test_utils.MockScriptWriter()
        WriteFingerprintAssertion(script_writer, target_info, source_info)
        self.assertEqual([('AssertSomeFingerprint', 'source-build-fingerprint',
                           'build-fingerprint-target')], script_writer.lines)
コード例 #3
0
    def test_WriteFingerprintAssertion_with_both_oem_props(self):
        target_info = common.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'].build_props['ro.build.thumbprint'] = (
            'source-build-thumbprint')
        source_info = common.BuildInfo(source_info_dict, self.TEST_OEM_DICTS)

        script_writer = test_utils.MockScriptWriter()
        WriteFingerprintAssertion(script_writer, target_info, source_info)
        self.assertEqual([('AssertSomeThumbprint', 'build-thumbprint',
                           'source-build-thumbprint')], script_writer.lines)