Beispiel #1
0
 def test_get_urls_multi(self):
     input_string = """
     @font-face {
     font-family: 'Roboto Condensed';
     font-style: normal;
     font-weight: 400;
     src: local('Roboto Condensed'), local('RobotoCondensed-Regular'),
     url(http://fonts.gstatic.com/s/robotocondensed/v13/Zd2E9abXLFGSr9G3YK2MsDR-eWpsHSw83BRsAQElGgc.ttf) format('truetype');
     }
     @font-face {
     font-family: 'Roboto Condensed';
     font-style: normal;
     font-weight: 700;
     src: local('Roboto Condensed Bold'), local('RobotoCondensed-Bold'),
     url(http://fonts.gstatic.com/s/robotocondensed/v13/b9QBgL0iMZfDSpmcXcE8nDokq8qT6AIiNJ07Vf_NrVA.ttf) format('truetype');
     }
     """
     expected = ['http://fonts.gstatic.com/s/robotocondensed/v13/Zd2E9abXLFGSr9G3YK2MsDR-eWpsHSw83BRsAQElGgc.ttf',
                 'http://fonts.gstatic.com/s/robotocondensed/v13/b9QBgL0iMZfDSpmcXcE8nDokq8qT6AIiNJ07Vf_NrVA.ttf']
     output = css_downloader.get_urls(input_string)
     self.assertListEqual(expected, output)
Beispiel #2
0
 def test_get_urls_broken(self):
     input_string = """url(http://example.com/path/to/file"""
     expected = []
     output = css_downloader.get_urls(input_string)
     self.assertListEqual(expected, output)