Home
last modified time | relevance | path

Searched refs:self (Results 1 – 25 of 73) 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.py47 def run_test(self, xml, apk, uses_libraries=[], optional_uses_libraries=[]): argument
75 def test_uses_library(self): argument
76 xml = self.xml_tmpl % (uses_library_xml('foo'))
77 apk = self.apk_tmpl % (uses_library_apk('foo'))
78 matches = self.run_test(xml, apk, uses_libraries=['foo'])
79 self.assertTrue(matches)
81 def test_uses_library_required(self): argument
82 xml = self.xml_tmpl % (uses_library_xml('foo', required_xml(True)))
83 apk = self.apk_tmpl % (uses_library_apk('foo', required_apk(True)))
84 matches = self.run_test(xml, apk, uses_libraries=['foo'])
[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("""
39 def test_ab(self): argument
40 CheckPartitionSizes(self.info_dict)
42 def test_non_ab(self): argument
43 self.info_dict.update(common.LoadDictionaryFromLines("""
48 CheckPartitionSizes(self.info_dict)
50 def test_non_dap(self): argument
51 self.info_dict.update(common.LoadDictionaryFromLines("""
54 with self.assertRaises(RuntimeError):
[all …]
Dtest_common.py188 def test_init(self): argument
189 target_info = common.BuildInfo(self.TEST_INFO_DICT, None)
190 self.assertEqual('product-device', target_info.device)
191 self.assertEqual('build-fingerprint', target_info.fingerprint)
192 self.assertFalse(target_info.is_ab)
193 self.assertIsNone(target_info.oem_props)
195 def test_init_with_oem_props(self): argument
196 target_info = common.BuildInfo(self.TEST_INFO_DICT_USES_OEM_PROPS,
197 self.TEST_OEM_DICTS)
198 self.assertEqual('device1', target_info.device)
[all …]
Dtest_ota_from_target_files.py92 def test_NoneDict(self): argument
93 self.assertIsNone(_LoadOemDicts(None))
95 def test_SingleDict(self): argument
101 self.assertEqual(1, len(oem_dicts))
102 self.assertEqual('foo', oem_dicts[0]['xyz'])
103 self.assertEqual('bar', oem_dicts[0]['a.b.c'])
105 def test_MultipleDicts(self): argument
115 self.assertEqual(3, len(oem_dicts))
117 self.assertEqual('2', oem_dict['def'])
118 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 …]
Dtest_verity_utils.py39 def setUp(self): argument
40 self.testdata_dir = get_testdata_dir()
42 self.partition_size = 1024 * 1024
43 self.prop_dict = {
47 'system_size': self.partition_size
50 self.hash_algorithm = "sha256"
51 self.fixed_salt = (
53 self.expected_root_hash = (
56 def _CreateSimg(self, raw_data): # pylint: disable=no-self-use argument
66 def _GenerateImage(self): argument
[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 …]
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 …]
Dverity_utils.py48 def __init__(self, message): argument
49 Exception.__init__(self, message)
231 def CalculateMaxImageSize(self, partition_size): argument
235 def CalculateDynamicPartitionSize(self, image_size): argument
239 def PadSparseImage(self, out_file): argument
243 def Build(self, out_file): argument
251 def __init__(self, partition_size, block_dev, fec_supported, signer_path, argument
253 self.version = 1
254 self.partition_size = partition_size
255 self.block_device = block_dev
[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_non_ab_ota.py29 def setUp(self): argument
31 def test_init(self): argument
33 self.assertEqual('ota-property-files', property_files.name)
34 self.assertEqual((), property_files.required)
35 self.assertEqual((), property_files.optional)
37 def test_Compute(self): argument
39 zip_file = self.construct_zip_package(entries)
44 tokens = self._parse_property_files_string(property_files_string)
45 self.assertEqual(2, len(tokens))
46 self._verify_entries(zip_file, tokens, entries)
[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 …]
/build/make/tools/
Dtest_post_process_props.py25 def test_createFromLine(self): argument
27 self.assertTrue(p.is_comment())
28 self.assertEqual("", p.name)
29 self.assertEqual("", p.value)
30 self.assertFalse(p.is_optional())
31 self.assertEqual("# this is comment", str(p))
35 self.assertFalse(p.is_comment())
36 self.assertEqual("a", p.name)
37 self.assertEqual("b", p.value)
38 self.assertFalse(p.is_optional())
[all …]
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/pesto/experiments/prepare_bazel_test_env/
Dbazelenv.py52 def __init__(self, soong_workspace: pathlib.Path): argument
53 self.soong_workspace = soong_workspace
55 self.soong_executable = self.soong_workspace.joinpath(
57 if not self.soong_executable.exists():
60 self.soong_executable)
62 def build(self, build_targets: Set[str]) -> None: argument
73 str(self.soong_executable), "--build-mode", "--all-modules",
84 cwd=self.soong_workspace,
113 def build_targets(self) -> set: argument
117 def stage(self, _): argument
[all …]
/build/soong/cc/symbolfile/
Dtest_symbolfile.py28 def test_decode_api_level(self) -> None: argument
29 self.assertEqual(9, symbolfile.decode_api_level('9', {}))
30 self.assertEqual(9000, symbolfile.decode_api_level('O', {'O': 9000}))
32 with self.assertRaises(KeyError):
37 def test_get_tags_no_tags(self) -> None: argument
38 self.assertEqual([], symbolfile.get_tags(''))
39 self.assertEqual([], symbolfile.get_tags('foo bar baz'))
41 def test_get_tags(self) -> None: argument
42 self.assertEqual(['foo', 'bar'], symbolfile.get_tags('# foo bar'))
43 self.assertEqual(['bar', 'baz'], symbolfile.get_tags('foo # bar baz'))
[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