Exemple #1
0
 def test_main_ttf(self, doc, downloader):
     doc.return_value = {'--ttf': True, '<url>': 'This is the url'}
     downloader.process_css_url.return_value = 'This is css'
     fonts_offline.main()
     assert doc.call_count == 1
     downloader.process_css_url.assert_called_once_with('This is the url',
                                                        {},
                                                        '')
Exemple #2
0
 def test_main(self, doc, downloader):
     doc.return_value = {'--ttf': False, '<url>': 'This is the url'}
     downloader.process_css_url.return_value = 'This is css'
     fonts_offline.main()
     assert doc.call_count == 1
     downloader.process_css_url.assert_called_once_with(
         'This is the url',
         {'User-agent': ('User-Agent: Mozilla/5.0 (X11;'
                         ' Linux x86_64; rv:38.0) Gecko/20100101'
                         'Firefox/38.0 Iceweasel/38.1.0')},
         '')
Exemple #3
0
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# "THE SCOTCH-WARE LICENSE" (Revision 42):
# <*****@*****.**> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a scotch whisky in return
# Marco 'don' Kaulea
# ----------------------------------------------------------------------------

import fonts_offline

if __name__ == "__main__":
    fonts_offline.main()