Home
last modified time | relevance | path

Searched refs:self (Results 1 – 25 of 56) sorted by relevance

123

/build/soong/scripts/
Dmanifest_fixer_test.py32 def test_sdk(self): argument
34 self.assertTrue(manifest_fixer.compare_version_gt('28', '27'))
35 self.assertFalse(manifest_fixer.compare_version_gt('27', '28'))
36 self.assertFalse(manifest_fixer.compare_version_gt('28', '28'))
38 def test_codename(self): argument
40 self.assertTrue(manifest_fixer.compare_version_gt('Q', 'P'))
41 self.assertFalse(manifest_fixer.compare_version_gt('P', 'Q'))
42 self.assertFalse(manifest_fixer.compare_version_gt('Q', 'Q'))
44 def test_sdk_codename(self): argument
46 self.assertTrue(manifest_fixer.compare_version_gt('Q', '28'))
[all …]
Dmanifest_check_test.py39 def run_test(self, input_manifest, uses_libraries=None, optional_uses_libraries=None): argument
55 def test_uses_library(self): argument
56 manifest_input = self.manifest_tmpl % (uses_library('foo'))
57 matches = self.run_test(manifest_input, uses_libraries=['foo'])
58 self.assertTrue(matches)
60 def test_uses_library_required(self): argument
61 manifest_input = self.manifest_tmpl % (uses_library('foo', required(True)))
62 matches = self.run_test(manifest_input, uses_libraries=['foo'])
63 self.assertTrue(matches)
65 def test_optional_uses_library(self): argument
[all …]
/build/make/tools/releasetools/
Dimages.py24 def RangeSha1(self, ranges): argument
27 def ReadRangeSet(self, ranges): argument
30 def TotalSha1(self, include_clobbered_blocks=False): argument
33 def WriteRangeDataToFd(self, ranges, fd): argument
40 def __init__(self): argument
41 self.blocksize = 4096
42 self.care_map = RangeSet()
43 self.clobbered_blocks = RangeSet()
44 self.extended = RangeSet()
45 self.total_blocks = 0
[all …]
Dtest_rangelib.py23 def test_union(self): argument
24 self.assertEqual(RangeSet("10-19 30-34").union(RangeSet("18-29")),
26 self.assertEqual(RangeSet("10-19 30-34").union(RangeSet("22 32")),
29 def test_intersect(self): argument
30 self.assertEqual(RangeSet("10-19 30-34").intersect(RangeSet("18-32")),
32 self.assertEqual(RangeSet("10-19 30-34").intersect(RangeSet("22-28")),
35 def test_subtract(self): argument
36 self.assertEqual(RangeSet("10-19 30-34").subtract(RangeSet("18-32")),
38 self.assertEqual(RangeSet("10-19 30-34").subtract(RangeSet("22-28")),
41 def test_overlaps(self): argument
[all …]
Dtest_check_partition_sizes.py22 def setUp(self): argument
23 self.info_dict = common.LoadDictionaryFromLines("""
38 def test_ab(self): argument
39 CheckPartitionSizes(self.info_dict)
41 def test_non_ab(self): argument
42 self.info_dict.update(common.LoadDictionaryFromLines("""
47 CheckPartitionSizes(self.info_dict)
49 def test_non_dap(self): argument
50 self.info_dict.update(common.LoadDictionaryFromLines("""
53 with self.assertRaises(RuntimeError):
[all …]
Dtest_verity_utils.py38 def setUp(self): argument
39 self.testdata_dir = get_testdata_dir()
41 self.partition_size = 1024 * 1024
42 self.prop_dict = {
46 'system_size': self.partition_size
49 self.hash_algorithm = "sha256"
50 self.fixed_salt = (
52 self.expected_root_hash = (
55 def _CreateSimg(self, raw_data): # pylint: disable=no-self-use argument
65 def _GenerateImage(self): argument
[all …]
Dtest_common.py170 def test_init(self): argument
171 target_info = common.BuildInfo(self.TEST_INFO_DICT, None)
172 self.assertEqual('product-device', target_info.device)
173 self.assertEqual('build-fingerprint', target_info.fingerprint)
174 self.assertFalse(target_info.is_ab)
175 self.assertIsNone(target_info.oem_props)
177 def test_init_with_oem_props(self): argument
178 target_info = common.BuildInfo(self.TEST_INFO_DICT_USES_OEM_PROPS,
179 self.TEST_OEM_DICTS)
180 self.assertEqual('device1', target_info.device)
[all …]
Dtest_ota_from_target_files.py80 def test_NoneDict(self): argument
81 self.assertIsNone(_LoadOemDicts(None))
83 def test_SingleDict(self): argument
89 self.assertEqual(1, len(oem_dicts))
90 self.assertEqual('foo', oem_dicts[0]['xyz'])
91 self.assertEqual('bar', oem_dicts[0]['a.b.c'])
93 def test_MultipleDicts(self): argument
103 self.assertEqual(3, len(oem_dicts))
105 self.assertEqual('2', oem_dict['def'])
106 self.assertEqual('foo', oem_dict['xyz'])
[all …]
Dtest_apex_utils.py33 def setUp(self): argument
34 self.testdata_dir = test_utils.get_testdata_dir()
36 self.payload_key = os.path.join(self.testdata_dir, 'testkey.key')
37 self.apex_with_apk = os.path.join(self.testdata_dir, 'has_apk.apex')
49 def test_ParseApexPayloadInfo(self): argument
50 payload_file = self._GetTestPayload()
52 'avbtool', payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048',
53 self.SALT, 'sha256', no_hashtree=True)
55 self.assertEqual('SHA256_RSA2048', payload_info['Algorithm'])
56 self.assertEqual(self.SALT, payload_info['Salt'])
[all …]
Dedify_generator.py23 def __init__(self, version, info, fstab=None): argument
24 self.script = []
25 self.mounts = set()
26 self._required_cache = 0
27 self.version = version
28 self.info = info
30 self.fstab = self.info.get("fstab", None)
32 self.fstab = fstab
35 def required_cache(self): argument
37 return self._required_cache
[all …]
Dverity_utils.py38 def __init__(self, message): argument
39 Exception.__init__(self, message)
221 def CalculateMaxImageSize(self, partition_size): argument
225 def CalculateDynamicPartitionSize(self, image_size): argument
229 def PadSparseImage(self, out_file): argument
233 def Build(self, out_file): argument
241 def __init__(self, partition_size, block_dev, fec_supported, signer_path, argument
243 self.version = 1
244 self.partition_size = partition_size
245 self.block_device = block_dev
[all …]
Dtest_blockimgdiff.py30 def __init__(self, score): argument
31 self.score = score
33 def test_init(self): argument
34 item1 = HeapItem(self.Item(15))
35 item2 = HeapItem(self.Item(20))
36 item3 = HeapItem(self.Item(15))
37 self.assertTrue(item1)
38 self.assertTrue(item2)
39 self.assertTrue(item3)
41 self.assertNotEqual(item1, item2)
[all …]
Dtest_sign_target_files_apks.py47 def setUp(self): argument
48 self.testdata_dir = test_utils.get_testdata_dir()
50 def test_EditTags(self): argument
51 self.assertEqual(EditTags('dev-keys'), ('release-keys'))
52 self.assertEqual(EditTags('test-keys'), ('release-keys'))
55 self.assertEqual(EditTags('abc,dev-keys,xyz'), ('abc,release-keys,xyz'))
58 self.assertEqual(EditTags('xyz,abc,dev-keys,xyz'), ('abc,release-keys,xyz'))
60 def test_RewriteAvbProps(self): argument
92 self.assertDictEqual(expected_dict, misc_info)
94 def test_RewriteProps(self): argument
[all …]
Drangelib.py33 def __init__(self, data=None): argument
34 self.monotonic = False
35 self._extra = {}
37 self._parse_internal(data)
40 self.data = tuple(self._remove_pairs(data))
41 self.monotonic = all(x < y for x, y in zip(self.data, self.data[1:]))
43 self.data = ()
45 def __iter__(self): argument
46 for i in range(0, len(self.data), 2):
47 yield self.data[i:i+2]
[all …]
Dtest_add_img_to_target_files.py34 def setUp(self): argument
54 def test_CheckAbOtaImages_imageExistsUnderImages(self): argument
56 images, _ = self._create_images(['aboot', 'xbl'], 'IMAGES')
59 def test_CheckAbOtaImages_imageExistsUnderRadio(self): argument
61 images, _ = self._create_images(['system', 'vendor'], 'IMAGES')
69 def test_CheckAbOtaImages_missingImages(self): argument
70 images, _ = self._create_images(['aboot', 'xbl'], 'RADIO')
71 self.assertRaises(
74 def test_AddPackRadioImages(self): argument
75 images, images_path = self._create_images(['foo', 'bar'], 'RADIO')
[all …]
Dota_package_parser.py27 def __init__(self): argument
28 self.blocks_stashed = 0
29 self.overlap_blocks_stashed = 0
30 self.max_stash_needed = 0
31 self.current_stash_size = 0
32 self.stash_map = {}
34 def StashBlocks(self, SHA1, blocks): argument
35 if SHA1 in self.stash_map:
38 self.blocks_stashed += blocks.size()
39 self.current_stash_size += blocks.size()
[all …]
Dtest_build_image.py33 def test_CheckHeadroom_SizeUnderLimit(self): argument
40 CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict)
42 def test_CheckHeadroom_InsufficientHeadroom(self): argument
49 self.assertRaises(
50 BuildImageError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict)
53 def test_CheckHeadroom_WrongFsType(self): argument
59 self.assertRaises(
60 AssertionError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict)
62 def test_CheckHeadroom_MissingProperties(self): argument
67 self.assertRaises(
[all …]
Dsparse_img.py43 def __init__(self, simg_fn, file_map_fn=None, clobbered_blocks=None, argument
46 self.simg_f = f = open(simg_fn, mode)
56 self.blocksize = blk_sz = header[5]
57 self.total_blocks = total_blks = header[6]
58 self.total_chunks = total_chunks = header[7]
83 self.offset_map = offset_map = []
84 self.clobbered_blocks = rangelib.RangeSet(data=clobbered_blocks)
137 self.generator_lock = threading.Lock()
139 self.care_map = rangelib.RangeSet(care_data)
140 self.offset_index = [i[0] for i in offset_map]
[all …]
/build/make/tools/
Dfat16copy.py81 def seek(self, amount, direction=0): argument
84 self.idx += amount
86 self.idx = self.size - amount
88 self.idx = amount
90 if self.idx < 0:
91 self.idx = 0
92 if self.idx > self.size:
93 self.idx = self.size
102 def __init__(self, fs, cluster, size=None): argument
109 self.fs = fs
[all …]
Devent_log_tags.py23 def __init__(self, tagnum, tagname, description, filename, linenum): argument
24 self.tagnum = tagnum
25 self.tagname = tagname
26 self.description = description
27 self.filename = filename
28 self.linenum = linenum
33 def AddError(self, msg, linenum=None): argument
35 linenum = self.linenum
36 self.errors.append((self.filename, linenum, msg))
38 def AddWarning(self, msg, linenum=None): argument
[all …]
Dauto_gen_test_config_test.py118 def setUp(self): argument
120 self.test_dir = tempfile.mkdtemp()
121 self.config_file = os.path.join(self.test_dir, TEST_MODULE + '.config')
122 self.manifest_file = os.path.join(self.test_dir, 'AndroidManifest.xml')
124 def tearDown(self): argument
126 shutil.rmtree(self.test_dir, ignore_errors=True)
128 def testInvalidManifest(self): argument
131 with open(self.manifest_file, 'w') as f:
134 argv = [self.config_file,
135 self.manifest_file,
[all …]
/build/soong/cc/
Dtest_gen_stub_libs.py29 def test_decode_api_level(self): argument
30 self.assertEqual(9, gsl.decode_api_level('9', {}))
31 self.assertEqual(9000, gsl.decode_api_level('O', {'O': 9000}))
33 with self.assertRaises(KeyError):
38 def test_get_tags_no_tags(self): argument
39 self.assertEqual([], gsl.get_tags(''))
40 self.assertEqual([], gsl.get_tags('foo bar baz'))
42 def test_get_tags(self): argument
43 self.assertEqual(['foo', 'bar'], gsl.get_tags('# foo bar'))
44 self.assertEqual(['bar', 'baz'], gsl.get_tags('foo # bar baz'))
[all …]
Dgen_stub_libs.py215 def __init__(self, multiply_defined_symbols): argument
216 super(MultiplyDefinedSymbolError, self).__init__(
219 self.multiply_defined_symbols = multiply_defined_symbols
224 def __init__(self, name, base, tags, symbols): argument
225 self.name = name
226 self.base = base
227 self.tags = tags
228 self.symbols = symbols
230 def __eq__(self, other): argument
231 if self.name != other.name:
[all …]
/build/make/tools/fs_config/
Dfs_config_generator.py42 def __init__(self, gen): argument
51 self._gen = gen
58 def __call__(self, cls): argument
60 generator._generators[self._gen] = cls()
143 def __init__(self, identifier, value, found, login_shell): argument
156 self.identifier = identifier
157 self.value = value
158 self.found = found
159 self.login_shell = login_shell
162 self.normalized_value = str(int(value, 0))
[all …]
Dtest_fs_config_generator.py22 def test_is_overlap(self): argument
25 self.assertTrue(AIDHeaderParser._is_overlap((0, 1), (1, 2)))
27 self.assertTrue(AIDHeaderParser._is_overlap((0, 100), (90, 200)))
29 self.assertTrue(AIDHeaderParser._is_overlap((20, 50), (1, 101)))
31 self.assertFalse(AIDHeaderParser._is_overlap((0, 100), (101, 200)))
33 self.assertFalse(AIDHeaderParser._is_overlap((-10, 0), (10, 20)))
35 def test_in_any_range(self): argument
38 self.assertFalse(Utils.in_any_range(50, [(100, 200), (1, 2), (1, 1)]))
39 self.assertFalse(Utils.in_any_range(250, [(100, 200), (1, 2), (1, 1)]))
41 self.assertTrue(Utils.in_any_range(100, [(100, 200), (1, 2), (1, 1)]))
[all …]

123