Пример #1
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.item1 = TextMenuItem(0.3807, 0.2604, "Text 1")
        self.item2 = TextMenuItem(0.3807, 0.2604, "Text 2", "Extra text 2")
        self.item3 = AnimatingMenuItem(0.3807, 0.2604, "Text 3", "Extra text 3")
Пример #2
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.progress_bar = ProgressBar(0.5, 0.9, 0.40, 0.04)
        self.media_player = MockMediaPlayer()
        self.progress_bar.media_player = self.media_player
Пример #3
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        filename = os.path.join(THIS_DIR, 'data/ImageThumbnailer/test.jpg')
        pix_buffer = gtk.gdk.pixbuf_new_from_file(filename)
        self.texture = RoundedTexture(0.5, 0.9, 0.40, 0.4, pix_buffer)
Пример #4
0
    def setUp(self):
        '''see unittest.TestCase'''
        EntertainerTest.setUp(self)

        self.message_bus = MessageBus()
        port = 45054 # Default port
        self.connection = ConnectionServer(port, self.message_bus)
Пример #5
0
    def setUp(self):
        '''see unittest.TestCase'''
        EntertainerTest.setUp(self)

        self.message_bus = MessageBus()
        port = 45054  # Default port
        self.connection = ConnectionServer(port, self.message_bus)
Пример #6
0
    def setUp(self):
        """Set up the test"""
        EntertainerTest.setUp(self)

        self.filename = os.path.join(THIS_DIR, 'data/ImageThumbnailer/test.jpg')

        self.texture = Texture(self.filename, 0.1, 0.2)
Пример #7
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.progress_bar = ProgressBar(0.5, 0.9, 0.40, 0.04)
        self.media_player =  MockMediaPlayer()
        self.progress_bar.media_player = self.media_player
Пример #8
0
    def setUp(self):
        '''Set up the test'''
        EntertainerTest.setUp(self)

        # Not testing the callback because it is used by the transitions only
        # so just provide None
        self.factory = TransitionFactory(None)
    def setUp(self):
        '''Set up the test'''
        EntertainerTest.setUp(self)

        # Not testing the callback because it is used by the transitions only
        # so just provide None
        self.factory = TransitionFactory(None)
    def setUp(self):
        """Set up the test."""
        EntertainerTest.setUp(self)

        filename = os.path.join(THIS_DIR, "data/ImageThumbnailer/test.jpg")
        pix_buffer = gtk.gdk.pixbuf_new_from_file(filename)
        self.texture = ReflectionTexture(0.5, 0.9, 0.40, 0.4, pix_buffer)
Пример #11
0
    def setUp(self):
        """Set up the test"""
        EntertainerTest.setUp(self)

        self.filename = os.path.join(THIS_DIR,
                                     'data/ImageThumbnailer/test.jpg')

        self.texture = Texture(self.filename, 0.1, 0.2)
Пример #12
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.player = MediaPlayer(clutter.Stage(), 100, 100)
        self.video_item = VideoItem()
        self.video_item.filename = THIS_DIR + '/data/VideoThumbnailer/test.avi'
        self.player.set_media(self.video_item)
Пример #13
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.item1 = TextMenuItem(0.3807, 0.2604, "Text 1")
        self.item2 = TextMenuItem(0.3807, 0.2604, "Text 2", "Extra text 2")
        self.item3 = AnimatingMenuItem(0.3807, 0.2604, "Text 3",
                                       "Extra text 3")
Пример #14
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = ImageMenu(0, 0)

        self.texture = Texture(os.path.join(
            THIS_DIR, 'data/ImageThumbnailer/test.jpg'))
Пример #15
0
    def tearDown(self):
        """Clean up after the test"""
        EntertainerTest.tearDown(self)

        connection = sqlite.connect(self.config.MUSIC_DB)
        cursor = connection.cursor()
        cursor.execute("""DROP TABLE IF EXISTS track""")
        connection.commit()
        connection.close()
Пример #16
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.filename = os.path.join(THIS_DIR, 'data/ImageThumbnailer/test.jpg')
        self.texture = Texture(self.filename)
        self.original_ratio = float(self.texture.get_width()) / \
            self.texture.get_height()

        self.item = ImageMenuItem(0.2, 0.1, self.texture)
Пример #17
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.screen = Screen()
        self.tabs_screen = Screen(has_tabs=True)
        self.tab = Tab('test')
        self.tabs_screen.add_tab(self.tab)

        self.select = UserEvent(UserEvent.NAVIGATE_SELECT)
Пример #18
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.screen = Screen()
        self.tabs_screen = Screen(has_tabs=True)
        self.tab = Tab('test')
        self.tabs_screen.add_tab(self.tab)

        self.select = UserEvent(UserEvent.NAVIGATE_SELECT)
Пример #19
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.tab_group = TabGroup(0.95, 0.13, 'title')

        tab1 = Tab("tab1", "title1", None)
        self.tab2 = Tab("foo", "title2", None)

        self.tab_group.add_tab(tab1)
        self.tab_group.add_tab(self.tab2)
Пример #20
0
    def setUp(self):
        EntertainerTest.setUp(self)

        image_libary = MockImageLibrary()
        music_library = MockMusicLibrary()
        media_player = MockMediaPlayer()
        video_library = MockVideoLibrary()
        self.factory = ScreenFactory(image_libary, music_library,
            video_library, media_player, None, None)

        self.kwargs = {}
Пример #21
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.filename = os.path.join(THIS_DIR,
                                     'data/ImageThumbnailer/test.jpg')
        self.texture = Texture(self.filename)
        self.original_ratio = float(self.texture.get_width()) / \
            self.texture.get_height()

        self.item = ImageMenuItem(0.2, 0.1, self.texture)
Пример #22
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.tab_group = TabGroup(0.95, 0.13, 'title')

        tab1 = Tab("tab1", "title1", None)
        self.tab2 = Tab("foo", "title2", None)

        self.tab_group.add_tab(tab1)
        self.tab_group.add_tab(self.tab2)
Пример #23
0
    def setUp(self):
        EntertainerTest.setUp(self)

        image_libary = MockImageLibrary()
        music_library = MockMusicLibrary()
        media_player = MockMediaPlayer()
        video_library = MockVideoLibrary()
        self.factory = ScreenFactory(image_libary, music_library,
                                     video_library, media_player, None, None)

        self.kwargs = {}
Пример #24
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = ScrollMenu(10, 60, 0.045, "menuitem_active")
        self.menu.set_name("mainmenu")

        self.menu.add_item(_("Play CD"), "disc")
        self.menu.add_item(_("Videos"), "videos")
        self.menu.add_item(_("Music"), "music")
        self.menu.add_item(_("Photographs"), "photo")
        self.menu.add_item(_("Headlines"), "rss")
Пример #25
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = ScrollMenu(10, 60, 0.045, "menuitem_active")
        self.menu.set_name("mainmenu")

        self.menu.add_item(_("Play CD"), "disc")
        self.menu.add_item(_("Videos"), "videos")
        self.menu.add_item(_("Music"), "music")
        self.menu.add_item(_("Photographs"), "photo")
        self.menu.add_item(_("Headlines"), "rss")
Пример #26
0
    def setUp(self):
        EntertainerTest.setUp(self)

        self.debug = False
        # The location of album art is required for some tests
        self.art_path = self.config.ALBUM_ART_DIR

        connection = sqlite.connect(self.config.MUSIC_DB)
        self.cursor = connection.cursor()
        self.cursor.execute("""DROP TABLE IF EXISTS track""")
        self.cursor.execute("""CREATE TABLE track(
                            filename TEXT,
                            title VARCHAR(255),
                            artist VARCHAR(255),
                            album VARCHAR(255),
                            tracknumber INTEGER,
                            bitrate INTEGER,
                            year INTEGER,
                            rating INTEGER DEFAULT NULL,
                            length INTEGER,
                            genre VARCHAR(128),
                            comment TEXT,
                            lyrics TEXT DEFAULT "",
                            PRIMARY KEY(filename))""")
        # Populate the test database with enough information to make it useful
        for i in range(2):
            for j in range(2):
                for k in range(2):
                    total = i + j + k # to get unique track numbers for albums
                    db_row = ('/filename/%s' % str(i) + str(j) + str(k),
                              'title%s' % str(i) + str(j),
                              'artist0',
                              'album%d' % j,
                              'genre%d' % i,
                              i + j + k, # length
                              total, # tracknumber
                              i, # bitrate
                              'comment%d' % i,
                              i  # year
                              )
                    self.cursor.execute("""INSERT INTO track(filename,
                                                             title,
                                                             artist,
                                                             album,
                                                             genre,
                                                             length,
                                                             tracknumber,
                                                             bitrate,
                                                             comment,
                                                             year)
                                        VALUES(?,?,?,?,?,?,?,?,?,?)""", db_row)

        connection.commit()
Пример #27
0
    def setUp(self):
        """Set up the test."""
        EntertainerTest.setUp(self)

        # Get a workable amount of text
        text = "Here is the start. "
        # pylint: disable-msg=W0612
        for i in range(0, 100):
            text += "Here is sentence number "

        self.label = Label(0.1, "screentitle", 0.1, 0.2, text)
        self.scroll_area = ScrollArea(0.5, 0.6, 0.1, 0.1, self.label)
Пример #28
0
    def setUp(self):
        """Set up the test."""
        EntertainerTest.setUp(self)

        # Get a workable amount of text
        text = "Here is the start. "
        # pylint: disable-msg=W0612
        for i in range(0, 100):
            text += "Here is sentence number "

        self.label = Label(0.1, "screentitle", 0.1, 0.2, text)
        self.scroll_area = ScrollArea(0.5, 0.6, 0.1, 0.1, self.label)
Пример #29
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = GridMenu(0, 0)

        self.cursor = clutter.Rectangle()

        self.item = MenuItem()
        self.item.userdata = "foo"

        self.menu.raw_add_item(MenuItem())
        self.menu.raw_add_item(MenuItem())
        self.menu.raw_add_item(self.item)
        self.menu.raw_add_item(MenuItem())

        self.menu.items_per_row = 2
        self.menu.items_per_col = 2
        self.menu.visible_rows = 2
        self.menu.visible_cols = 2
Пример #30
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = GridMenu(0, 0)

        self.cursor = clutter.Rectangle()

        self.item = MenuItem()
        self.item.userdata = "foo"

        self.menu.raw_add_item(MenuItem())
        self.menu.raw_add_item(MenuItem())
        self.menu.raw_add_item(self.item)
        self.menu.raw_add_item(MenuItem())

        self.menu.items_per_row = 2
        self.menu.items_per_col = 2
        self.menu.visible_rows = 2
        self.menu.visible_cols = 2
Пример #31
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.indicator = VolumeIndicator()
        clutter.Stage().add(self.indicator)
Пример #32
0
 def setUp(self):
     """See unittest.TestCase"""
     EntertainerTest.setUp(self)
     self.debug = False
Пример #33
0
 def tearDown(self):
     """Clean up after the test"""
     EntertainerTest.tearDown(self)
Пример #34
0
 def tearDown(self):
     '''Clean up after the test.'''
     EntertainerTest.tearDown(self)
Пример #35
0
 def setUp(self):
     """See unittest.TestCase"""
     EntertainerTest.setUp(self)
     self.debug = False
     self.filename = (
         THIS_DIR + '/data/ImageThumbnailer/test.jpg')
Пример #36
0
    def setUp(self):
        """Set up the test."""
        EntertainerTest.setUp(self)

        self.buffer = MotionBuffer()
Пример #37
0
 def tearDown(self):
     """Clean up after the test"""
     EntertainerTest.tearDown(self)
Пример #38
0
 def setUp(self):
     EntertainerTest.setUp(self)
     self.filename = unicode(os.path.join(self.data_dir, self.filename))
Пример #39
0
 def setUp(self):
     """Set up test"""
     self.NUMBER_OF_MESSAGE_TYPES = len(
         [k for k, v in vars(MessageType).items() if type(v) is int])
     EntertainerTest.setUp(self)
Пример #40
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = TextMenu()
Пример #41
0
    def setUp(self):
        """Set up the test"""
        EntertainerTest.setUp(self)

        self.theme = Theme(self.config.theme_path)
Пример #42
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.menu = TextMenu()
Пример #43
0
    def setUp(self):
        """Sets up everything for the test"""
        EntertainerTest.setUp(self)

        self.weather = Weather("Bath,England")
Пример #44
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.item = MenuItem()
Пример #45
0
    def setUp(self):
        """Set up the test"""
        EntertainerTest.setUp(self)

        self.label = Label(0.1, "screentitle", 0.1, 0.2, "Test Label text",
            "test_name")
Пример #46
0
    def setUp(self):
        '''See unittest.TestCase'''
        EntertainerTest.setUp(self)

        self.logger = Logger()
Пример #47
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.test_resource = self.test_cfg_dir.replace('/', '')
        self.resources = Resources(resource=self.test_resource)
Пример #48
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.arrow = ArrowTexture(0.5, 0.9, 0.40, (21, 45, 83, 255),
            (255, 0, 0, 255), ArrowTexture.UP)
Пример #49
0
    def setUp(self):
        """Sets up everything for the test"""
        EntertainerTest.setUp(self)

        self.weather = Weather("Bath,England")
Пример #50
0
    def setUp(self):
        EntertainerTest.setUp(self)

        self.screen_history = ScreenHistory(None)
Пример #51
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.item = MenuItem()
Пример #52
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.buffer = MotionBuffer()
Пример #53
0
 def tearDown(self):
     '''See unittest.TestCase'''
     EntertainerTest.tearDown(self)
Пример #54
0
 def setUp(self):
     '''See unittest.TestCase'''
     EntertainerTest.setUp(self)
     self.debug = False
Пример #55
0
    def setUp(self):
        '''Set up the test.'''
        EntertainerTest.setUp(self)

        self.arrow = ArrowTexture(0.5, 0.9, 0.40, (21, 45, 83, 255),
                                  (255, 0, 0, 255), ArrowTexture.UP)
Пример #56
0
    def setUp(self):
        """Set up the test"""
        EntertainerTest.setUp(self)

        self.base = Base()