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