Skip to content

Commit

Permalink
Changed structure of files, added pytest option to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Aug 9, 2013
1 parent 7a0b8d0 commit bcf5ead
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 16 deletions.
5 changes: 4 additions & 1 deletion python-api/Makefile
Expand Up @@ -9,8 +9,11 @@ lint:
coverage:
mkdir -p reports
mkdir -p reports/coverage
-py.test --cov-report html --cov gstswitch gstswitch -v
-py.test --cov-report html --cov gstswitch -v
mv htmlcov/*.* reports/coverage
rmdir htmlcov
rm *.data

pytest:
-py.test tests/unittests -v

Empty file added python-api/__init__.py
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
@@ -1,8 +1,12 @@
from connection import Connection
from exception import *
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../")))

from gstswitch.connection import Connection
from gstswitch.exception import *
import pytest
from gi.repository import Gio, GLib
from mock import Mock, patch
from mock import Mock


class TestAddress(object):
Expand Down
@@ -1,8 +1,12 @@
from controller import Controller
from exception import ConnectionReturnError
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../")))

from gstswitch.controller import Controller
from gstswitch.exception import ConnectionReturnError
import pytest
from mock import Mock, patch
from connection import Connection
from gstswitch.connection import Connection
from gi.repository import GLib


Expand Down
@@ -1,7 +1,11 @@
from helpers import TestSources, PreviewSinks
from exception import RangeError, InvalidIndexError
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../")))

from gstswitch.helpers import TestSources, PreviewSinks
from gstswitch.exception import RangeError, InvalidIndexError
import pytest
import testsource
import gstswitch.testsource


class TestTestSourcesVideoPort(object):
Expand Down Expand Up @@ -50,7 +54,7 @@ def run(self):

def test_new_test_video(self, monkeypatch):
test = TestSources(video_port=3000)
monkeypatch.setattr(testsource, 'VideoSrc', self.MockVideoSrc)
monkeypatch.setattr(gstswitch.testsource, 'VideoSrc', self.MockVideoSrc)
test.new_test_video()
assert test.running_tests[0] is not None
assert len(test.running_tests) != 0
Expand Down Expand Up @@ -137,7 +141,7 @@ def end(self):

def test_run(self, monkeypatch):
preview = PreviewSinks()
monkeypatch.setattr(testsource, 'Preview', self.MockPreview)
monkeypatch.setattr(gstswitch.testsource, 'Preview', self.MockPreview)
preview.run()
assert preview.preview is not None

Expand Down
@@ -1,6 +1,10 @@
from server import Server
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../")))

from gstswitch.server import Server
import pytest
from exception import *
from gstswitch.exception import *
import os
import subprocess
from mock import Mock
Expand Down
@@ -1,5 +1,9 @@
from exception import RangeError
from testsource import Preview, VideoSrc, BasePipeline, VideoPipeline
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../")))

from gstswitch.exception import RangeError
from gstswitch.testsource import Preview, VideoSrc, BasePipeline, VideoPipeline
import pytest
from mock import Mock, patch
from gi.repository import Gst
Expand Down

0 comments on commit bcf5ead

Please sign in to comment.