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.
Added unittest for BaseServer.get_control_port
- Loading branch information
Showing
2 changed files
with
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,12 @@ def get_control_port(self): | |
:param: None | ||
This comment has been minimized.
Sorry, something went wrong. |
||
:returns: Control port | ||
""" | ||
if type(self.CONTROL_PORT) != str: | ||
This comment has been minimized.
Sorry, something went wrong.
mithro
Collaborator
|
||
raise TypeError("Control port: " + self.CONTROL_PORT + " should be a string") | ||
try: | ||
int(self.CONTROL_PORT) | ||
except: | ||
raise ValueError("Control port: " + self.CONTROL_PORT + " should have integral value") | ||
return self.CONTROL_PORT | ||
|
||
def get_record_file(self): | ||
|
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
You shouldn't be doing these checks in get_control_port.....