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