Skip to content

Commit

Permalink
test for OSError in terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Jul 22, 2013
1 parent e8c38b7 commit fab6c53
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python-api/gstswitch/test_server.py
@@ -1,6 +1,7 @@
from server import Server
import pytest
from exception import *
import subprocess


class TestPath(object):
Expand Down Expand Up @@ -90,6 +91,23 @@ def test_invalid_control_port_range(self):
Server(path=path, control_port=control_port)


class TestProcess(object):
# OS Errors
def test_terminate_fail(self):
class fake_proc(object):
def __init__(self):
pass

def terminate(self):
raise OSError

path = '/home/hyades/gst/master/gstreamer/tools/'
s = Server(path=path)
s.proc = fake_proc()
with pytest.raises(ServerProcessError):
s.terminate()


class TestNormal(object):
# Normal Functioning Tests
def test_normal_terminate(self):
Expand Down

0 comments on commit fab6c53

Please sign in to comment.