mirror of
https://github.com/Guake/guake.git
synced 2025-10-26 11:27:13 +00:00
- quick edit freeze guake - warn about unsupported regex in ubuntu 17.10 - fix translation not found with contextual menu - quick open appears in contextual menu (#1157) sem-ver: bugfix Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
31 lines
705 B
Python
31 lines
705 B
Python
import re
|
|
|
|
from guake.globals import QUICK_OPEN_MATCHERS
|
|
from mock import Mock
|
|
from textwrap import dedent
|
|
|
|
|
|
def test_quick_open():
|
|
chunk = dedent(
|
|
"""
|
|
Traceback (most recent call last):
|
|
File "./test.py", line 5, in <module>
|
|
os.path('/bad/path')
|
|
TypeError: 'module' object is not callable
|
|
"""
|
|
)
|
|
|
|
found = _execute_quick_open(chunk)
|
|
assert found == [('./test.py', '5')]
|
|
|
|
|
|
def _execute_quick_open(chunk):
|
|
found = []
|
|
|
|
for line in chunk.split('\n'):
|
|
for _1, _2, r in QUICK_OPEN_MATCHERS:
|
|
g = re.compile(r).match(line)
|
|
if g:
|
|
found.append((g.group(1), g.group(2)))
|
|
return found
|