(self)
| 3458 | |
| 3459 | |
| 3460 | def test_prefixes(self): |
| 3461 | # Get the list of defined string prefixes. I don't see an |
| 3462 | # obvious documented way of doing this, but probably the best |
| 3463 | # thing is to split apart tokenize.StringPrefix. |
| 3464 | |
| 3465 | # Make sure StringPrefix begins and ends in parens. We're |
| 3466 | # assuming it's of the form "(a|b|ab)", if a, b, and cd are |
| 3467 | # valid string prefixes. |
| 3468 | self.assertEqual(tokenize.StringPrefix[0], '(') |
| 3469 | self.assertEqual(tokenize.StringPrefix[-1], ')') |
| 3470 | |
| 3471 | # Then split apart everything else by '|'. |
| 3472 | defined_prefixes = set(tokenize.StringPrefix[1:-1].split('|')) |
| 3473 | |
| 3474 | # Now compute the actual allowed string prefixes and compare |
| 3475 | # to what is defined in the tokenize module. |
| 3476 | self.assertEqual(defined_prefixes, self.determine_valid_prefixes()) |
| 3477 | |
| 3478 | |
| 3479 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected