コード例 #1
0
 def test_1(self):
     """Test magic_run_completer, should match two alternatives
     """
     event = MockEvent(u"%run a")
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, {u"a.py", u"aao.py", u"adir/"})
コード例 #2
0
 def test_2(self):
     """Test magic_run_completer, should match one alternative
     """
     event = MockEvent(u"%run aa")
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, {u"aao.py"})
コード例 #3
0
 def test_1(self):
     """Test magic_run_completer, should match two alterntives
     """
     event = MockEvent("%run a")
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, set(["a.py", "aaø.py"]))
コード例 #4
0
ファイル: test_completerlib.py プロジェクト: anderwm/ipython
 def test_2(self):
     """Test magic_run_completer, should match one alterntive
     """
     event = MockEvent(u"%run aa")
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, set([u"aaø.py"]))
コード例 #5
0
ファイル: test_completerlib.py プロジェクト: hrocha/ipython
 def test_1(self):
     """Test magic_run_completer, should match two alterntives
     """
     event = MockEvent(u"%run a")
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, {u"a.py", u"aao.py", u"adir/"})
コード例 #6
0
 def test_1(self):
     """Test magic_run_completer, should match two alterntives
     """
     event = MockEvent("%run a")
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, set(["a.py", "aaø.py"]))
コード例 #7
0
ファイル: test_completerlib.py プロジェクト: deep-jkl/ipython
 def test_completion_in_dir(self):
     # Github issue #3459
     event = MockEvent(u'%run a.py {}'.format(join(self.BASETESTDIR, 'a')))
     print(repr(event.line))
     match = set(magic_run_completer(None, event))
     # We specifically use replace here rather than normpath, because
     # at one point there were duplicates 'adir' and 'adir/', and normpath
     # would hide the failure for that.
     self.assertEqual(match, {join(self.BASETESTDIR, f).replace('\\','/')
                         for f in (u'a.py', u'aao.py', u'aao.txt', u'adir/')})
コード例 #8
0
ファイル: test_completerlib.py プロジェクト: hrocha/ipython
 def test_completion_in_dir(self):
     # Github issue #3459
     event = MockEvent(u'%run a.py {}'.format(join(self.BASETESTDIR, 'a')))
     print(repr(event.line))
     match = set(magic_run_completer(None, event))
     # We specifically use replace here rather than normpath, because
     # at one point there were duplicates 'adir' and 'adir/', and normpath
     # would hide the failure for that.
     self.assertEqual(match, {join(self.BASETESTDIR, f).replace('\\','/')
                         for f in (u'a.py', u'aao.py', u'aao.txt', u'adir/')})
コード例 #9
0
 def test_completion_more_args(self):
     event = MockEvent(u'%run a.py ')
     match = set(magic_run_completer(None, event))
     self.assertEqual(match, set(self.files + self.dirs))
コード例 #10
0
 def test_3(self):
     """Test magic_run_completer with unterminated " """
     event = MockEvent(u'%run "a')
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, {u"a.py", u"aao.py", u"adir/"})
コード例 #11
0
ファイル: test_completerlib.py プロジェクト: anderwm/ipython
 def test_3(self):
     """Test magic_run_completer with unterminated " """
     event = MockEvent(u'%run "a')
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, set([u"a.py", u"aaø.py"]))
コード例 #12
0
ファイル: test_completerlib.py プロジェクト: hrocha/ipython
 def test_completion_more_args(self):
     event = MockEvent(u'%run a.py ')
     match = set(magic_run_completer(None, event))
     self.assertEqual(match, set(self.files + self.dirs))
コード例 #13
0
 def test_3(self):
     """Test magic_run_completer with unterminated " """
     event = MockEvent('%run "a')
     mockself = None
     match = set(magic_run_completer(mockself, event))
     self.assertEqual(match, set(["a.py", "aaø.py"]))