Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Smirl/processes
Processes
- Loading branch information
Showing
5 changed files
with
129 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Test the search functionality.""" | ||
|
||
import logging | ||
|
||
import pytest | ||
|
||
from baroness.search import search | ||
from baroness.utils import LOGGER | ||
|
||
LOGGER.setLevel(logging.DEBUG) | ||
|
||
|
||
@pytest.fixture | ||
def workdir(tmpdir): | ||
""" | ||
A place to add files to search. | ||
Create a directory called package/ | ||
""" | ||
tmpdir.mkdir('package') | ||
return tmpdir | ||
|
||
|
||
@pytest.fixture | ||
def python_file(workdir): | ||
"""Set up temporary files and return the tmpdir.""" | ||
workdir.join('main.py').write('''print("hello")\n''') | ||
|
||
|
||
def test_search(workdir, python_file, capsys): | ||
"""Test the standard code path which yeilds results.""" | ||
search([str(workdir)], 'root("name")', verbose=1) |