Esempio n. 1
0
class Movieparser(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(671)

    def test_in(self):
        found_movies = self.fa.search_movie('Leon zawodowiec')
        self.assertTrue(self.movie in found_movies)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        self.assertEqual(len(self.movie['cast']), 78)

        p = self.movie['cast'][0]
        self.assertEqual(p['title'], u'Jean Reno')
        self.assertEqual(p['roleName'], u'Léon')
        self.assertEqual(p['roleType'], u'aktor')
        self.assertEqual(p.objID, 88)

    def test_infos(self):
        print self.movie['basicinfo']
        self.assertEqual(len(self.movie['additionalinfo']), 5)

        self.assertEqual(len(self.movie['basicinfo']), 5)

        self.assertEqual(len(self.movie['photos']), 45)

        self.assertEqual('Leon zawodowiec', self.movie.title, )
        # self.assertEqual('Léon',self.movie['title_original'],)

    def test_year(self):
        self.assertEqual(self.movie['year'], '1994')
Esempio n. 2
0
class XmenImagesGalleryTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(489280)

    def test_images(self):
        self.assertEqual(len(self.movie['photos']), 46)
Esempio n. 3
0
class CheckMovieInfos(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(107552)

    def test_in(self):
        found_movies = self.fa.search_movie(u'Dziewczyna z sąsiedztwa')
        self.assertTrue(self.movie in found_movies)
Esempio n. 4
0
class CheckMovieInfos(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(107552)

    def test_in(self):
        found_movies = self.fa.search_movie(u'Dziewczyna z sąsiedztwa')
        self.assertTrue(self.movie in found_movies)
Esempio n. 5
0
class IxjanaTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(598624)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        p = self.movie['cast'][5]
        self.assertEqual(p['roleType'], u'aktor')
Esempio n. 6
0
class IxjanaTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(598624)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        p = self.movie['cast'][5]
        self.assertEqual(p['roleType'], u'aktor')
Esempio n. 7
0
class SztukaKochaniaTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(763312)

    def test_cast(self):
        self.assertEquals(len(self.movie['cast']), 30)
        self.assertNotEqual(self.movie['cast'][-1]['roleType'], 'aktor')
        self.assertEquals(len(self.movie['photos']), 28)
Esempio n. 8
0
class SztukaKochaniaTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(763312)

    def test_cast(self):
        self.assertEquals(len(self.movie['cast']), 30)
        self.assertNotEqual(self.movie['cast'][-1]['roleType'], 'aktor')
        self.assertEquals(len(self.movie['photos']), 28)
Esempio n. 9
0
class XmenImagesGalleryTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(489280)

    def test_images(self):
        self.assertEqual(len(self.movie['photos']), 46)

        for photo in self.movie['photos']:
            self.assertIsNotNone(is_valid_url(photo['image']), msg=photo['image'])
Esempio n. 10
0
class EpisodesTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(130177) #Dr House
    def test_episode(self):
        episode = self.movie['episodes'][47]
        self.assertEqual(episode['name'],u'Cane & Able')
        self.assertEqual(episode['season'],3)
        self.assertEqual(episode['number'],2)
        self.assertEqual(episode['date'],datetime.strptime("2006-09-12","%Y-%m-%d" ))
Esempio n. 11
0
class XmenImagesGalleryTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(489280)

    def test_images(self):
        self.assertEqual(len(self.movie['photos']), 46)

        for photo in self.movie['photos']:
            self.assertIsNotNone(is_valid_url(photo['image']),
                                 msg=photo['image'])
Esempio n. 12
0
class Serialparser(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.serial = self.fa.get_movie(33993)

    def test_in(self):
        found_movies = self.fa.search_movie('Przyjaciele')
        self.assertTrue(self.serial in found_movies)

    def test_year(self):
        self.assertEqual(self.serial['year'], '1994-2004')
Esempio n. 13
0
class Serialparser(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.serial = self.fa.get_movie(33993)

    def test_in(self):
        found_movies = self.fa.search_movie('Przyjaciele')
        self.assertTrue(self.serial in found_movies)

    def test_year(self):
        self.assertEqual(self.serial['year'], '1994-2004')
Esempio n. 14
0
class NadZycieTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(651141)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        p = self.movie['cast'][3]
        self.assertEqual(p['roleType'], u'aktor')

    def test_posters(self):
        self.assertEqual(len(self.movie['posters']), 2)
Esempio n. 15
0
class EpisodesTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(130177)  # Dr House

    def test_episode(self):
        episode = self.movie['episodes'][47]
        self.assertEqual(episode['name'], u'Cane & Able')
        self.assertEqual(episode['season'], 3)
        self.assertEqual(episode['number'], 2)
        self.assertEqual(episode['date'],
                         datetime.strptime("2006-09-12", "%Y-%m-%d"))
Esempio n. 16
0
class CheckMovieInfos(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(107552)

    def test_in(self):
        found_movies = self.fa.search_movie(u'Dziewczyna z sąsiedztwa')
        self.assertTrue( self.movie in found_movies )

    def test_levenstein(self):
        org_title = u'The Girl Next Door'.replace("The","")
        self.assertEqual('The Girl Next Door',self.movie['title_original'])
        self.assertEqual( Levenshtein.distance(org_title,self.movie['title_original'].replace("The","")) , 0 )
Esempio n. 17
0
class NadZycieTest(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(651141)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        p = self.movie['cast'][3]
        self.assertEqual(p['roleType'], u'aktor')

    def test_posters(self):
        self.assertEqual(len(self.movie['posters']), 2)

        for poster in self.movie['posters']:
            self.assertIsNotNone(is_valid_url(poster['href']))
Esempio n. 18
0
class Movieparser(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(671)

    def test_in(self):
        found_movies = self.fa.search_movie('Leon zawodowiec')
        self.assertTrue(self.movie in found_movies)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        self.assertEqual(len(self.movie['cast']), 101)

        p = self.movie['cast'][0]
        self.assertEqual(p['title'], u'Jean Reno')
        self.assertEqual(p['roleName'], u'Léon')
        self.assertEqual(p['roleType'], u'aktor')
        self.assertEqual(p.objID, 88)

        for type in [
                'aktor', u'reżyser', 'scenarzysta', u'zdjęcia', 'muzyka',
                u'montaż', 'scenografia', 'kostiumy', 'producent', u'dźwięk'
        ]:
            self.assertTrue(any([
                cast for cast in self.movie['cast'] if cast['roleType'] == type
            ]),
                            msg='missing %s' % type)

    def test_infos(self):
        self.assertEqual(len(self.movie['additionalinfo']), 5)

        self.assertEqual(len(self.movie['basicinfo']), 5)

        self.assertEqual(len(self.movie['photos']), 45)

        self.assertEqual(
            'Leon zawodowiec',
            self.movie.title,
        )
        # self.assertEqual('Léon',self.movie['title_original'],)

    def test_year(self):
        self.assertEqual(self.movie['year'], '1994')
Esempio n. 19
0
class Movieparser(unittest.TestCase):
    def setUp(self):
        self.fa = Filmweb('http')
        self.movie = self.fa.get_movie(671)

    def test_in(self):
        found_movies = self.fa.search_movie('Leon zawodowiec')
        self.assertTrue(self.movie in found_movies)

    def test_cast(self):
        self.assertIsNotNone(self.movie['cast'])
        self.assertEqual(len(self.movie['cast']), 101)

        p = self.movie['cast'][0]
        self.assertEqual(p['title'], u'Jean Reno')
        self.assertEqual(p['roleName'], u'Léon')
        self.assertEqual(p['roleType'], u'aktor')
        self.assertEqual(p.objID, 88)

        for type in ['aktor', u'reżyser', 'scenarzysta', u'zdjęcia', 'muzyka', u'montaż', 'scenografia', 'kostiumy',
                     'producent', u'dźwięk']:
            self.assertTrue(
                any([cast for cast in self.movie['cast'] if cast['roleType'] == type]), msg='missing %s' % type
            )

    def test_infos(self):
        self.assertEqual(len(self.movie['additionalinfo']), 5)

        self.assertEqual(len(self.movie['basicinfo']), 5)

        self.assertEqual(len(self.movie['photos']), 45)

        self.assertEqual('Leon zawodowiec', self.movie.title, )
        # self.assertEqual('Léon',self.movie['title_original'],)

    def test_year(self):
        self.assertEqual(self.movie['year'], '1994')
Esempio n. 20
0
 def setUp(self):
     fw = Filmweb()
     self.movie = fw.get_movie(635169)
Esempio n. 21
0
 def setUp(self):
     fw = Filmweb()
     self.movie = fw.get_movie(635169)