-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
60 additions
and
14 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
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,28 @@ | ||
import pytest | ||
|
||
from contextlib import redirect_stdout | ||
from cpac.backends import Backends | ||
from io import StringIO, TextIOWrapper, BytesIO | ||
|
||
|
||
@pytest.mark.parametrize('platform', ['docker', 'singularity']) | ||
def test_loading_message(platform): | ||
redirect_out = StringIO() | ||
with redirect_stdout(redirect_out): | ||
loaded = Backends(platform) | ||
with_symbol = ' '.join([ | ||
'Loading', | ||
loaded.platform.symbol, | ||
loaded.platform.name | ||
]) | ||
assert with_symbol in redirect_out.getvalue() | ||
|
||
redirect_out = TextIOWrapper( | ||
BytesIO(), encoding='latin-1', errors='strict', write_through=True) | ||
with redirect_stdout(redirect_out): | ||
loaded = Backends(platform) | ||
without_symbol = ' '.join([ | ||
'Loading', | ||
loaded.platform.name | ||
]) | ||
assert without_symbol in redirect_out.buffer.getvalue().decode() |