Beispiel #1
0
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
import mythboxtest
import unittest2 as unittest
import feedparser

log = mythboxtest.getLogger('mythbox.unittest')


class FeedParserTest(unittest.TestCase):
    def test_mythbox_atom_feed(self):
        d = feedparser.parse(
            'http://mythbox-xbmc.blogspot.com/feeds/posts/default')
        log.debug('Atom title = %s' % d.feed.title)
        log.debug('Atom link  = %s' % d.feed.link)
        log.debug('Atom desc  = %s' % d.feed.description)
        log.debug('Atom date  = %s' % d.feed.date)
        log.debug('Atom dp    = %s' % d.feed.date_parsed)

        for entry in d.entries:
            log.debug('Entry link = %s' % entry.link)
            log.debug('Entry desc = %s' % entry.description)
Beispiel #2
0
import datetime
import mythbox.mythtv.protocol as protocol
import time
import unittest2 as unittest
import util_mock
import mythboxtest

from mockito import Mock
from mythbox.mythtv.db import MythDatabase
from mythbox.mythtv.domain import RecordedProgram
from mythbox.platform import Platform
from mythbox.settings import MythSettings
from mythbox.util import OnDemandConfig
from mockito.mockito import when

log = mythboxtest.getLogger('mythbox.unittest')


class MythDatabaseTest(unittest.TestCase):

    def setUp(self):
        self.platform = Platform()
        self.langInfo = util_mock.XBMCLangInfo(self.platform)
        self.translator = util_mock.Translator(self.platform, self.langInfo)
        self.settings = MythSettings(self.platform, self.translator)
        self.protocol = protocol.Protocol56()
        privateConfig = OnDemandConfig()
        self.settings.put('mysql_host', privateConfig.get('mysql_host'))
        self.settings.put('mysql_port', privateConfig.get('mysql_port'))
        self.settings.put('mysql_database', privateConfig.get('mysql_database'))
        self.settings.put('mysql_user', privateConfig.get('mysql_user'))  
Beispiel #3
0
import logging
import unittest
import mythboxtest
import util_mock
import unittest2 as unittest

from mockito import Mock
from mythbox.mythtv.db import MythDatabase
from mythbox.mythtv.domain import RecordingSchedule, Job
from mythbox.platform import Platform
from mythbox.settings import MythSettings
from mythbox.util import OnDemandConfig
from mythbox.mythtv.conn import Connection
from mythbox.mythtv.enums import JobType

log = mythboxtest.getLogger("mythbox.unittest")


class MythDatabaseTest(unittest.TestCase):
    def setUp(self):
        self.platform = Platform()

        # self.translator = Mock()
        self.langInfo = util_mock.XBMCLangInfo(self.platform)
        self.translator = util_mock.Translator(self.platform, self.langInfo)

        self.bus = Mock()
        self.domainCache = Mock()
        self.settings = MythSettings(self.platform, self.translator)

        privateConfig = OnDemandConfig()