Home
last modified time | relevance | path

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

12

/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 …]
/build/make/tools/releasetools/
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_ota_from_target_files.py84 def __init__(self): argument
85 self.script = []
87 def Mount(self, *args): argument
88 self.script.append(('Mount',) + args)
90 def AssertDevice(self, *args): argument
91 self.script.append(('AssertDevice',) + args)
93 def AssertOemProperty(self, *args): argument
94 self.script.append(('AssertOemProperty',) + args)
96 def AssertFingerprintOrThumbprint(self, *args): argument
97 self.script.append(('AssertFingerprintOrThumbprint',) + args)
[all …]
Dtest_verity_utils.py37 def setUp(self): argument
38 self.testdata_dir = get_testdata_dir()
40 self.partition_size = 1024 * 1024
41 self.prop_dict = {
45 'system_size': self.partition_size
48 self.hash_algorithm = "sha256"
49 self.fixed_salt = \
51 self.expected_root_hash = \
54 def _create_simg(self, raw_data): argument
63 self.assertEqual(0, p.returncode)
[all …]
Dtest_common.py49 def _verify(self, zip_file, zip_file_name, arcname, expected_hash, argument
55 self.assertEqual(int(expected_stat.st_mode), int(new_stat.st_mode))
56 self.assertEqual(int(expected_stat.st_mtime), int(new_stat.st_mtime))
63 self.assertEqual(info.date_time, (2009, 1, 1, 0, 0, 0))
67 self.assertEqual(mode, expected_mode)
70 self.assertEqual(info.compress_type, expected_compress_type)
77 self.assertEqual(expected_hash, sha1_hash.hexdigest())
78 self.assertIsNone(zip_file.testzip())
80 def _test_ZipWrite(self, contents, extra_zipwrite_args=None): argument
113 self._verify(zip_file, zip_file_name, arcname, sha1_hash.hexdigest(),
[all …]
Dtest_apex_utils.py30 def setUp(self): argument
31 self.testdata_dir = test_utils.get_testdata_dir()
33 self.payload_key = os.path.join(self.testdata_dir, 'testkey.key')
42 def test_ParseApexPayloadInfo(self): argument
43 payload_file = self._GetTestPayload()
45 payload_file, self.payload_key, 'testkey', 'SHA256_RSA2048', self.SALT)
47 self.assertEqual('SHA256_RSA2048', payload_info['Algorithm'])
48 self.assertEqual(self.SALT, payload_info['Salt'])
49 self.assertEqual('testkey', payload_info['apex.key'])
51 def test_SignApexPayload(self): argument
[all …]
Dtest_blockimgdiff.py31 def __init__(self, score): argument
32 self.score = score
34 def test_init(self): argument
35 item1 = HeapItem(self.Item(15))
36 item2 = HeapItem(self.Item(20))
37 item3 = HeapItem(self.Item(15))
38 self.assertTrue(item1)
39 self.assertTrue(item2)
40 self.assertTrue(item3)
42 self.assertNotEqual(item1, item2)
[all …]
Dverity_utils.py38 def __init__(self, message): argument
39 Exception.__init__(self, message)
217 def CalculateMaxImageSize(self, partition_size): argument
221 def CalculateDynamicPartitionSize(self, image_size): argument
225 def PadSparseImage(self, out_file): argument
229 def Build(self, out_file): argument
237 def __init__(self, partition_size, block_dev, fec_supported, signer_path, argument
239 self.version = 1
240 self.partition_size = partition_size
241 self.block_device = block_dev
[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_sign_target_files_apks.py41 def setUp(self): argument
42 self.testdata_dir = test_utils.get_testdata_dir()
44 def test_EditTags(self): argument
45 self.assertEqual(EditTags('dev-keys'), ('release-keys'))
46 self.assertEqual(EditTags('test-keys'), ('release-keys'))
49 self.assertEqual(EditTags('abc,dev-keys,xyz'), ('abc,release-keys,xyz'))
52 self.assertEqual(EditTags('xyz,abc,dev-keys,xyz'), ('abc,release-keys,xyz'))
54 def test_RewriteProps(self): argument
104 self.assertEqual(expected + '\n', RewriteProps(prop))
107 self.assertEqual(
[all …]
Dblockimgdiff.py64 def RangeSha1(self, ranges): argument
67 def ReadRangeSet(self, ranges): argument
70 def TotalSha1(self, include_clobbered_blocks=False): argument
73 def WriteRangeDataToFd(self, ranges, fd): argument
80 def __init__(self): argument
81 self.blocksize = 4096
82 self.care_map = RangeSet()
83 self.clobbered_blocks = RangeSet()
84 self.extended = RangeSet()
85 self.total_blocks = 0
[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
37 def _verifyCareMap(self, expected, file_name): argument
47 self.assertEqual('\n'.join(expected), plain_text)
66 def test_CheckAbOtaImages_imageExistsUnderImages(self): argument
68 images, _ = self._create_images(['aboot', 'xbl'], 'IMAGES')
71 def test_CheckAbOtaImages_imageExistsUnderRadio(self): argument
73 images, _ = self._create_images(['system', 'vendor'], 'IMAGES')
81 def test_CheckAbOtaImages_missingImages(self): argument
82 images, _ = self._create_images(['aboot', 'xbl'], 'RADIO')
83 self.assertRaises(
[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.py32 def test_CheckHeadroom_SizeUnderLimit(self): argument
39 CheckHeadroom(self.EXT4FS_OUTPUT, prop_dict)
41 def test_CheckHeadroom_InsufficientHeadroom(self): argument
48 self.assertRaises(
49 BuildImageError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict)
51 def test_CheckHeadroom_WrongFsType(self): argument
57 self.assertRaises(
58 AssertionError, CheckHeadroom, self.EXT4FS_OUTPUT, prop_dict)
60 def test_CheckHeadroom_MissingProperties(self): argument
65 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 …]
Dcheck_target_files_signatures66 def _decodeExtra(self): argument
108 def __init__(self): argument
109 self.certs = {}
111 def Add(self, cert, name=None): argument
112 if cert in self.certs:
114 self.certs[cert] = self.certs[cert] + "," + name
119 self.certs[cert] = name
121 def Get(self, cert): argument
123 return self.certs.get(cert, None)
125 def FindLocalCerts(self): argument
[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 …]
Dparsedeps.py10 def __init__(self, tgt): argument
11 self.tgt = tgt
12 self.pos = ""
13 self.prereqs = set()
14 self.visit = 0
16 def add(self, prereq): argument
17 self.prereqs.add(prereq)
21 def __init__(self): argument
22 self.lines = {}
23 self.__visit = 0
[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 …]

12