forked from timvideos/gst-switch
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
3 changed files
with
59 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from helpers import TestSources, PreviewSinks | ||
from exception import RangeError | ||
import pytest | ||
from mock import Mock, patch | ||
|
||
|
||
class TestTestSourcesVideoPort(object): | ||
|
||
def test_blank(self): | ||
tests = ['', None, [], {}] | ||
for test in tests: | ||
with pytest.raises(ValueError): | ||
TestSources(video_port=test) | ||
|
||
def test_range(self): | ||
tests = [-100, 1e7, 65536] | ||
for test in tests: | ||
with pytest.raises(RangeError): | ||
TestSources(video_port=test) | ||
|
||
def test_invalid(self): | ||
tests = [[1, 2, 3, 4], {1: 2, 2: 3}, '1e10'] | ||
for test in tests: | ||
with pytest.raises(TypeError): | ||
TestSources(video_port=test) | ||
|
||
def test_normal(self): | ||
tests = [1, 65535, 1000] | ||
for test in tests: | ||
src = TestSources(video_port=test) | ||
assert src.video_port == test |