Lines Matching refs:self
29 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'))
46 def test_split_tag(self): argument
47 self.assertTupleEqual(('foo', 'bar'), gsl.split_tag('foo=bar'))
48 self.assertTupleEqual(('foo', 'bar=baz'), gsl.split_tag('foo=bar=baz'))
49 with self.assertRaises(ValueError):
52 def test_get_tag_value(self): argument
53 self.assertEqual('bar', gsl.get_tag_value('foo=bar'))
54 self.assertEqual('bar=baz', gsl.get_tag_value('foo=bar=baz'))
55 with self.assertRaises(ValueError):
58 def test_is_api_level_tag(self): argument
59 self.assertTrue(gsl.is_api_level_tag('introduced=24'))
60 self.assertTrue(gsl.is_api_level_tag('introduced-arm=24'))
61 self.assertTrue(gsl.is_api_level_tag('versioned=24'))
64 self.assertFalse(gsl.is_api_level_tag('arm'))
65 self.assertFalse(gsl.is_api_level_tag('introduced'))
66 self.assertFalse(gsl.is_api_level_tag('versioned'))
69 self.assertFalse(gsl.is_api_level_tag('versioned-arm=24'))
71 def test_decode_api_level_tags(self): argument
93 self.assertListEqual(
96 with self.assertRaises(gsl.ParseError):
101 def test_version_is_private(self): argument
102 self.assertFalse(gsl.version_is_private('foo'))
103 self.assertFalse(gsl.version_is_private('PRIVATE'))
104 self.assertFalse(gsl.version_is_private('PLATFORM'))
105 self.assertFalse(gsl.version_is_private('foo_private'))
106 self.assertFalse(gsl.version_is_private('foo_platform'))
107 self.assertFalse(gsl.version_is_private('foo_PRIVATE_'))
108 self.assertFalse(gsl.version_is_private('foo_PLATFORM_'))
110 self.assertTrue(gsl.version_is_private('foo_PRIVATE'))
111 self.assertTrue(gsl.version_is_private('foo_PLATFORM'))
115 def test_symbol_in_arch(self): argument
116 self.assertTrue(gsl.symbol_in_arch([], 'arm'))
117 self.assertTrue(gsl.symbol_in_arch(['arm'], 'arm'))
119 self.assertFalse(gsl.symbol_in_arch(['x86'], 'arm'))
121 def test_symbol_in_api(self): argument
122 self.assertTrue(gsl.symbol_in_api([], 'arm', 9))
123 self.assertTrue(gsl.symbol_in_api(['introduced=9'], 'arm', 9))
124 self.assertTrue(gsl.symbol_in_api(['introduced=9'], 'arm', 14))
125 self.assertTrue(gsl.symbol_in_api(['introduced-arm=9'], 'arm', 14))
126 self.assertTrue(gsl.symbol_in_api(['introduced-arm=9'], 'arm', 14))
127 self.assertTrue(gsl.symbol_in_api(['introduced-x86=14'], 'arm', 9))
128 self.assertTrue(gsl.symbol_in_api(
130 self.assertTrue(gsl.symbol_in_api(
132 self.assertTrue(gsl.symbol_in_api(
134 self.assertTrue(gsl.symbol_in_api(
137 self.assertFalse(gsl.symbol_in_api(['introduced=14'], 'arm', 9))
138 self.assertFalse(gsl.symbol_in_api(['introduced-arm=14'], 'arm', 9))
139 self.assertFalse(gsl.symbol_in_api(['future'], 'arm', 9))
140 self.assertFalse(gsl.symbol_in_api(
142 self.assertFalse(gsl.symbol_in_api(
144 self.assertFalse(gsl.symbol_in_api(
146 self.assertFalse(gsl.symbol_in_api(
148 self.assertFalse(gsl.symbol_in_api(
154 self.assertTrue(gsl.symbol_in_api(['x86'], 'arm', 9))
156 def test_verioned_in_api(self): argument
157 self.assertTrue(gsl.symbol_versioned_in_api([], 9))
158 self.assertTrue(gsl.symbol_versioned_in_api(['versioned=9'], 9))
159 self.assertTrue(gsl.symbol_versioned_in_api(['versioned=9'], 14))
161 self.assertFalse(gsl.symbol_versioned_in_api(['versioned=14'], 9))
165 def test_omit_private(self): argument
166 self.assertFalse(
170 self.assertTrue(
173 self.assertTrue(
177 self.assertTrue(
182 def test_omit_vndk(self): argument
183 self.assertTrue(
187 self.assertFalse(
190 self.assertFalse(
194 def test_omit_apex(self): argument
195 self.assertTrue(
199 self.assertFalse(
202 self.assertFalse(
206 def test_omit_arch(self): argument
207 self.assertFalse(
210 self.assertFalse(
214 self.assertTrue(
218 def test_omit_api(self): argument
219 self.assertFalse(
222 self.assertFalse(
227 self.assertTrue(
234 def test_omit_vndk(self): argument
235 self.assertTrue(
239 self.assertFalse(
241 self.assertFalse(
245 def test_omit_apex(self): argument
246 self.assertTrue(
250 self.assertFalse(
252 self.assertFalse(
256 def test_omit_arch(self): argument
257 self.assertFalse(
259 self.assertFalse(
263 self.assertTrue(
267 def test_omit_api(self): argument
268 self.assertFalse(
270 self.assertFalse(
274 self.assertTrue(
280 def test_next_line(self): argument
289 self.assertIsNone(parser.current_line)
291 self.assertEqual('foo', parser.next_line().strip())
292 self.assertEqual('foo', parser.current_line.strip())
294 self.assertEqual('bar', parser.next_line().strip())
295 self.assertEqual('bar', parser.current_line.strip())
297 self.assertEqual('qux', parser.next_line().strip())
298 self.assertEqual('qux', parser.current_line.strip())
300 self.assertEqual('', parser.next_line())
301 self.assertEqual('', parser.current_line)
303 def test_parse_version(self): argument
317 self.assertEqual('VERSION_1', version.name)
318 self.assertIsNone(version.base)
319 self.assertEqual(['foo', 'bar'], version.tags)
325 self.assertEqual(expected_symbols, version.symbols)
329 self.assertEqual('VERSION_2', version.name)
330 self.assertEqual('VERSION_1', version.base)
331 self.assertEqual([], version.tags)
333 def test_parse_version_eof(self): argument
339 with self.assertRaises(gsl.ParseError):
342 def test_unknown_scope_label(self): argument
350 with self.assertRaises(gsl.ParseError):
353 def test_parse_symbol(self): argument
362 self.assertEqual('foo', symbol.name)
363 self.assertEqual([], symbol.tags)
367 self.assertEqual('bar', symbol.name)
368 self.assertEqual(['baz', 'qux'], symbol.tags)
370 def test_wildcard_symbol_global(self): argument
378 with self.assertRaises(gsl.ParseError):
381 def test_wildcard_symbol_local(self): argument
391 self.assertEqual([], version.symbols)
393 def test_missing_semicolon(self): argument
401 with self.assertRaises(gsl.ParseError):
404 def test_parse_fails_invalid_input(self): argument
405 with self.assertRaises(gsl.ParseError):
410 def test_parse(self): argument
442 self.assertEqual(expected, versions)
444 def test_parse_vndk_apex_symbol(self): argument
457 self.assertEqual('VERSION_1', version.name)
458 self.assertIsNone(version.base)
466 self.assertEqual(expected_symbols, version.symbols)
470 def test_omit_version(self): argument
481 self.assertEqual('', src_file.getvalue())
482 self.assertEqual('', version_file.getvalue())
488 self.assertEqual('', src_file.getvalue())
489 self.assertEqual('', version_file.getvalue())
495 self.assertEqual('', src_file.getvalue())
496 self.assertEqual('', version_file.getvalue())
498 def test_omit_symbol(self): argument
509 self.assertEqual('', src_file.getvalue())
510 self.assertEqual('', version_file.getvalue())
516 self.assertEqual('', src_file.getvalue())
517 self.assertEqual('', version_file.getvalue())
523 self.assertEqual('', src_file.getvalue())
524 self.assertEqual('', version_file.getvalue())
530 self.assertEqual('', src_file.getvalue())
531 self.assertEqual('', version_file.getvalue())
533 def test_write(self): argument
562 self.assertEqual(expected_src, src_file.getvalue())
577 self.assertEqual(expected_version, version_file.getvalue())
581 def test_integration(self): argument
633 self.assertEqual(expected_src, src_file.getvalue())
649 self.assertEqual(expected_version, version_file.getvalue())
651 def test_integration_future_api(self): argument
680 self.assertEqual(expected_src, src_file.getvalue())
689 self.assertEqual(expected_version, version_file.getvalue())
691 def test_multiple_definition(self): argument
718 with self.assertRaises(gsl.MultiplyDefinedSymbolError) as cm:
720 self.assertEquals(['bar', 'foo'],
723 def test_integration_with_apex(self): argument
780 self.assertEqual(expected_src, src_file.getvalue())
799 self.assertEqual(expected_version, version_file.getvalue())