コード例 #1
0
def get_data():

    data = {
        "monitor": {
            "name": "monitor",
            "thumbnail_url": "http:/xyz.com",
            "description": "monitor",
            "splitter_addr": "localhost",
            "splitter_port": "4552"
        }
    }
    return data


path = file_util.find_file(__file__, "../../data/channels/sample_data.p2psp")


#unittests are sorted according to their name and then run.
#edit tearDown method to retain exported channels file  and vice-versa.
class Import_Export_Test(unittest.TestCase):

    exported_data = None
    imported_data = None

    def tearDown(self):
        if Import_Export_Test.imported_data is None:
            pass
        else:
            file_util.file_del(path)
            #pass
コード例 #2
0
import unittest
import json

def get_data():
    
   data = {"monitor":
           { "name" : "monitor"
           ,"thumbnail_url" : "http:/xyz.com"
           ,"description" : "monitor"
           ,"splitter_addr" : "localhost"
           ,"splitter_port" : "4552" }
           }
   return data
   
path = file_util.find_file(__file__,
                                    "../../data/channels/sample_data.p2psp")

#unittests are sorted according to their name and then run.
#edit tearDown method to retain exported channels file  and vice-versa.
class Import_Export_Test(unittest.TestCase):
    
    exported_data = None
    imported_data = None
    
    def tearDown(self):
        if Import_Export_Test.imported_data is None:
            pass
        else:
            file_util.file_del(path)
            #pass
            
コード例 #3
0
ファイル: test_gtk3player.py プロジェクト: ishit/p2psp
#script tested with python2.7

import sys,os

module_path = os.path.join(os.path.dirname(__file__),"../../..")
sys.path.append(module_path)

import src.common.file_util as file_util
from src.common.decorators import exc_handler
from gi.repository import GdkX11
from gi.repository import Gtk
from src.lib import vlc


path = file_util.find_file(__file__,
                                    "../../../data/images/p2psp.jpg")
                                    
class Gtk3Player():
    """A VLC window.
    The player can be controlled through 'player', which
    is a vlc.MediaPlayer() instance.
    """
    def __init__(self):
        self.interface = file_util.get_user_interface(__file__,
                                        '../../../data/glade/test_player_surface.glade')
        self.load_widgets()
        self.draw_area.set_size_request(300,300)
        self.draw_area.connect("realize",self._realized)
        self.window.connect("destroy",Gtk.main_quit)
        self.window.show()