Show More
@@ -613,66 +613,6 b' def test_dict_key_completion_bytes():' | |||
|
613 | 613 | nt.assert_not_in("abd", matches) |
|
614 | 614 | |
|
615 | 615 | |
|
616 | def test_dict_key_completion_unicode_py2(): | |
|
617 | """Test handling of unicode in dict key completion""" | |
|
618 | ip = get_ipython() | |
|
619 | complete = ip.Completer.complete | |
|
620 | ||
|
621 | ip.user_ns['d'] = {u'abc': None, | |
|
622 | u'a\u05d0b': None} | |
|
623 | ||
|
624 | _, matches = complete(line_buffer="d[") | |
|
625 | nt.assert_in("u'abc'", matches) | |
|
626 | nt.assert_in("u'a\\u05d0b'", matches) | |
|
627 | ||
|
628 | _, matches = complete(line_buffer="d['a") | |
|
629 | nt.assert_in("abc", matches) | |
|
630 | nt.assert_not_in("a\\u05d0b", matches) | |
|
631 | ||
|
632 | _, matches = complete(line_buffer="d[u'a") | |
|
633 | nt.assert_in("abc", matches) | |
|
634 | nt.assert_in("a\\u05d0b", matches) | |
|
635 | ||
|
636 | _, matches = complete(line_buffer="d[U'a") | |
|
637 | nt.assert_in("abc", matches) | |
|
638 | nt.assert_in("a\\u05d0b", matches) | |
|
639 | ||
|
640 | # query using escape | |
|
641 | if sys.platform != 'win32': | |
|
642 | # Known failure on Windows | |
|
643 | _, matches = complete(line_buffer=u"d[u'a\\u05d0") | |
|
644 | nt.assert_in("u05d0b", matches) # tokenized after \\ | |
|
645 | ||
|
646 | # query using character | |
|
647 | _, matches = complete(line_buffer=u"d[u'a\u05d0") | |
|
648 | nt.assert_in(u"a\u05d0b", matches) | |
|
649 | ||
|
650 | with greedy_completion(): | |
|
651 | _, matches = complete(line_buffer="d[") | |
|
652 | nt.assert_in("d[u'abc']", matches) | |
|
653 | nt.assert_in("d[u'a\\u05d0b']", matches) | |
|
654 | ||
|
655 | _, matches = complete(line_buffer="d['a") | |
|
656 | nt.assert_in("d['abc']", matches) | |
|
657 | nt.assert_not_in("d[u'a\\u05d0b']", matches) | |
|
658 | ||
|
659 | _, matches = complete(line_buffer="d[u'a") | |
|
660 | nt.assert_in("d[u'abc']", matches) | |
|
661 | nt.assert_in("d[u'a\\u05d0b']", matches) | |
|
662 | ||
|
663 | _, matches = complete(line_buffer="d[U'a") | |
|
664 | nt.assert_in("d[U'abc']", matches) | |
|
665 | nt.assert_in("d[U'a\\u05d0b']", matches) | |
|
666 | ||
|
667 | # query using escape | |
|
668 | _, matches = complete(line_buffer=u"d[u'a\\u05d0") | |
|
669 | nt.assert_in("d[u'a\\u05d0b']", matches) # tokenized after \\ | |
|
670 | ||
|
671 | # query using character | |
|
672 | _, matches = complete(line_buffer=u"d[u'a\u05d0") | |
|
673 | nt.assert_in(u"d[u'a\u05d0b']", matches) | |
|
674 | ||
|
675 | ||
|
676 | 616 | def test_dict_key_completion_unicode_py3(): |
|
677 | 617 | """Test handling of unicode in dict key completion""" |
|
678 | 618 | ip = get_ipython() |
General Comments 0
You need to be logged in to leave comments.
Login now