2008-08-21 22:25:24 +08:00
|
|
|
|
2009-02-27 18:18:27 +08:00
|
|
|
pytest_plugins = "pytest_pytester"
|
|
|
|
|
|
|
|
class TestPyLookup:
|
|
|
|
def test_basic(self, testdir):
|
|
|
|
p = testdir.makepyfile(hello="def x(): pass")
|
|
|
|
result = testdir.runpybin("py.lookup", "pass")
|
|
|
|
result.stdout.fnmatch_lines(
|
2008-08-21 22:25:24 +08:00
|
|
|
['%s:*def x(): pass' %(p.basename)]
|
|
|
|
)
|
|
|
|
|
2009-02-27 18:18:27 +08:00
|
|
|
def test_search_in_filename(self, testdir):
|
|
|
|
p = testdir.makepyfile(hello="def x(): pass")
|
|
|
|
result = testdir.runpybin("py.lookup", "hello")
|
|
|
|
result.stdout.fnmatch_lines(
|
2008-08-21 22:25:24 +08:00
|
|
|
['*%s:*' %(p.basename)]
|
|
|
|
)
|
|
|
|
|