Skip to content

Commit

Permalink
Fix record file format
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Jan 7, 2015
1 parent 75959d4 commit c6c83c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python-api/gstswitch/server.py
Expand Up @@ -40,7 +40,7 @@ def __init__(
video_port=3000,
audio_port=4000,
control_port=5000,
record_file='record-%Y-%m-%d %H%M%S.data'):
record_file='record-%Y-%m-%d_%H%M%S.data'):

super(Server, self).__init__()

Expand Down
6 changes: 3 additions & 3 deletions python-api/tests/integrationtests/test_controller.py
Expand Up @@ -382,7 +382,7 @@ def new_record(self):
def test_new_record(self):
"""Test new_record"""
for _ in range(self.NUM):
serv = Server(path=PATH, record_file="test-%Y-%m-%d %H%M%S.data")
serv = Server(path=PATH, record_file="test-%Y-%m-%d_%H%M%S.data")
try:
serv.run()

Expand All @@ -392,8 +392,8 @@ def test_new_record(self):

curr_time = datetime.datetime.now()
alt_curr_time = curr_time + datetime.timedelta(0, 1)
time_str = curr_time.strftime('%Y-%m-%d %H%M%S')
alt_time_str = alt_curr_time.strftime('%Y-%m-%d %H%M%S')
time_str = curr_time.strftime('%Y-%m-%d_%H%M%S')
alt_time_str = alt_curr_time.strftime('%Y-%m-%d_%H%M%S')
test_filename = "test-{0}.data".format(time_str)
alt_test_filename = "test-{0}.data".format(alt_time_str)

Expand Down
6 changes: 3 additions & 3 deletions python-api/tests/unittests/test_server_unit.py
Expand Up @@ -29,7 +29,7 @@ def mock_method(arg):
serv._start_process = mock_method
assert serv._run_process().split() == "/usr/gst-switch-srv \
--video-input-port=3000 --audio-input-port=4000 \
--control-port=5000 --record=record-%Y-%m-%d %H%M%S.data".split()
--control-port=5000 --record=record-%Y-%m-%d_%H%M%S.data".split()

def test_path_provided_no_slash(self):
"""Test if a path is provided"""
Expand All @@ -41,7 +41,7 @@ def mock_method(arg):
serv._start_process = mock_method
assert serv._run_process().split() == "/usr/gst-switch-srv \
--video-input-port=3000 --audio-input-port=4000 \
--control-port=5000 --record=record-%Y-%m-%d %H%M%S.data".split()
--control-port=5000 --record=record-%Y-%m-%d_%H%M%S.data".split()

def test_path_empty(self, monkeypatch):
"""Test if null path is given"""
Expand All @@ -60,7 +60,7 @@ def mockreturn(path):
serv._start_process = mock_method
assert serv._run_process().split() == "/usr/gst-switch-srv \
--video-input-port=3000 --audio-input-port=4000 \
--control-port=5000 --record=record-%Y-%m-%d %H%M%S.data".split()
--control-port=5000 --record=record-%Y-%m-%d_%H%M%S.data".split()


class TestVideoPort(object):
Expand Down

0 comments on commit c6c83c7

Please sign in to comment.