Skip to content

Commit

Permalink
Checking if the record file is properly created
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Aug 22, 2013
1 parent 61f1c6b commit 05b1293
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions python-api/tests/integrationtests/test_controller.py
Expand Up @@ -6,14 +6,15 @@
from gstswitch.helpers import *
from gstswitch.controller import Controller
import time
import datetime

from compare import CompareVideo

import subprocess

PATH = '/home/hyades/gst/stage/bin/'

class sTestEstablishConnection(object):
class TestEstablishConnection(object):

NUM = 1
# fails above 3
Expand All @@ -37,7 +38,7 @@ def test_establish(self):



class sTestGetComposePort(object):
class TestGetComposePort(object):

NUM = 1
FACTOR = 1
Expand Down Expand Up @@ -74,7 +75,7 @@ def test_compose_ports(self):
assert set(at) == set(bt)


class sTestGetEncodePort(object):
class TestGetEncodePort(object):

NUM = 1
FACTOR = 1
Expand Down Expand Up @@ -111,7 +112,7 @@ def test_encode_ports(self):
assert set(at) == set(bt)


class sTestGetAudioPortVideoFirst(object):
class TestGetAudioPortVideoFirst(object):

NUM = 1
FACTOR = 1
Expand Down Expand Up @@ -152,7 +153,7 @@ def test_audio_ports(self):
assert set(at) == set(bt)


class sTestGetAudioPortAudioFirst(object):
class TestGetAudioPortAudioFirst(object):

NUM = 1
FACTOR = 1
Expand Down Expand Up @@ -193,7 +194,7 @@ def test_audio_ports(self):
assert set(at) == set(bt)


class sTestGetPreviewPorts(object):
class TestGetPreviewPorts(object):

NUM = 1
FACTOR = 1
Expand Down Expand Up @@ -229,7 +230,7 @@ def test_get_preview_ports(self):
s.terminate()


class sTestSetCompositeMode(object):
class TestSetCompositeMode(object):

NUM = 1
FACTOR = 1
Expand Down Expand Up @@ -322,20 +323,27 @@ def new_record(self):
def test_new_record(self):

for i in range(self.NUM):
s = Server(path=PATH)
s = Server(path=PATH, record_file="test.data")
try:
s.run()

sources = TestSources(video_port=3000)
sources.new_test_video()
sources.new_test_video()

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')
test_filename = "test {0}.data".format(time_str)
alt_test_filename = "test {0}.data".format(alt_time_str)

res = self.new_record()

print res
sources.terminate_video()
s.terminate()
# print ((os.path.exists(test_filename)) or (os.path.exists(alt_test_filename)))
assert ((os.path.exists(test_filename)) or (os.path.exists(alt_test_filename))) == True
finally:
if s.proc:
s.terminate()

0 comments on commit 05b1293

Please sign in to comment.