-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 parent
39c5f8e
commit d7cabc5
Showing
2 changed files
with
21 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
import os | ||
import pytest | ||
|
||
is_pyd = os.environ.get('PYD') | ||
is_pynih = os.environ.get('PYNIH') | ||
|
||
|
||
def test_protocol(): | ||
from phobos import Protocol | ||
if is_pyd: | ||
with pytest.raises(ImportError): | ||
from phobos import Protocol | ||
else: | ||
from phobos import Protocol, ProtocolType | ||
|
||
protocol = Protocol() | ||
assert protocol.getProtocolByType(ProtocolType.TCP) | ||
|
||
assert protocol.name == "tcp" | ||
assert protocol.aliases == ["TCP"] |