Esempio n. 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/"})
Esempio n. 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"})
 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"]))
Esempio n. 4
0
 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"]))
Esempio n. 5
0
 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/"})
Esempio n. 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"]))
Esempio n. 7
0
 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/')})
Esempio n. 8
0
 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/')})
Esempio n. 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))
Esempio n. 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/"})
Esempio n. 11
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, set([u"a.py", u"aaø.py"]))
Esempio n. 12
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))
Esempio n. 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"]))