(self)
| 606 | |
| 607 | class TestQueryCompleter(unittest.TestCase): |
| 608 | def setUp(self): |
| 609 | cli_driver = CLIDriver() |
| 610 | self.cli_fetcher = fetcher.CliDriverFetcher(cli_driver) |
| 611 | index = InMemoryIndex( |
| 612 | { |
| 613 | 'command_names': { |
| 614 | '': [('aws', None)], |
| 615 | 'aws': [('ec2', None)], |
| 616 | 'aws.ec2': [('describe-instances', None)], |
| 617 | }, |
| 618 | 'arg_names': { |
| 619 | '': { |
| 620 | 'aws': ['query', 'output'], |
| 621 | }, |
| 622 | 'aws.ec2': { |
| 623 | 'describe-instances': [], |
| 624 | }, |
| 625 | }, |
| 626 | 'arg_data': { |
| 627 | '': { |
| 628 | 'aws': { |
| 629 | 'query': ( |
| 630 | 'query', |
| 631 | 'string', |
| 632 | 'aws', |
| 633 | '', |
| 634 | None, |
| 635 | False, |
| 636 | False, |
| 637 | ), |
| 638 | 'output': ( |
| 639 | 'output', |
| 640 | 'string', |
| 641 | 'aws', |
| 642 | '', |
| 643 | None, |
| 644 | False, |
| 645 | False, |
| 646 | ), |
| 647 | } |
| 648 | }, |
| 649 | 'aws.ec2': {'describe-instances': {}}, |
| 650 | }, |
| 651 | } |
| 652 | ) |
| 653 | self.parser = parser.CLIParser(index) |
| 654 | self.completer = basic.QueryCompleter( |
| 655 | self.cli_fetcher, response_filter=filters.fuzzy_filter |
| 656 | ) |
| 657 | |
| 658 | def _assert_in_completions(self, name, completions): |
| 659 | self.assertIn(name, [completion.name for completion in completions]) |
nothing calls this directly
no test coverage detected