Ejemplo 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/"})
Ejemplo 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"]))
Ejemplo 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"]))
Ejemplo 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/"})
Ejemplo 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"]))
Ejemplo 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/')})
Ejemplo 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/')})
Ejemplo 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))
Ejemplo 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/"})
Ejemplo 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"]))
Ejemplo 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))
Ejemplo 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"]))