Skip to content

Commit

Permalink
the record filename is now set via a parameter, fix test accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
MaZderMind committed Jan 11, 2015
1 parent 27a2d40 commit 4a9544e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions python-api/tests/integrationtests/test_controller.py
Expand Up @@ -365,28 +365,21 @@ def new_record(self):

def test_new_record(self):
"""Test new_record"""
the_record_file = "test.data"
for _ in range(self.NUM):
serv = Server(path=PATH, record_file="test.data")
serv = Server(path=PATH, record_file=the_record_file)
try:
serv.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()
serv.terminate(1)
assert ((os.path.exists(test_filename)) or
(os.path.exists(alt_test_filename))) is True
assert os.path.exists(the_record_file) is True
finally:
if serv.proc:
poll = serv.proc.poll()
Expand Down

0 comments on commit 4a9544e

Please sign in to comment.