2008-08-21 22:25:24 +08:00
|
|
|
from py.__.test.testing import suptest
|
|
|
|
from py.__.test.testing.acceptance_test import AcceptBase
|
|
|
|
|
|
|
|
class TestPyLookup(AcceptBase):
|
|
|
|
def test_basic(self):
|
|
|
|
p = self.makepyfile(hello="def x(): pass")
|
2008-09-23 03:30:13 +08:00
|
|
|
result = self.runpybin("py.lookup", "pass")
|
2008-08-21 22:25:24 +08:00
|
|
|
suptest.assert_lines_contain_lines(result.outlines,
|
|
|
|
['%s:*def x(): pass' %(p.basename)]
|
|
|
|
)
|
|
|
|
|
|
|
|
def test_search_in_filename(self):
|
|
|
|
p = self.makepyfile(hello="def x(): pass")
|
2008-09-10 01:47:39 +08:00
|
|
|
result = self.runpybin("py.lookup", "hello")
|
2008-08-21 22:25:24 +08:00
|
|
|
suptest.assert_lines_contain_lines(result.outlines,
|
|
|
|
['*%s:*' %(p.basename)]
|
|
|
|
)
|
|
|
|
|