Skip to content

Commit 95172ae

Browse files
committed
Test coverage fixes
1 parent 4a75885 commit 95172ae

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

icon_font_to_png/command_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def run(arguments):
154154
def download_icon_font(icon_font, directory):
155155
try:
156156
return AVAILABLE_ICON_FONTS[icon_font]['downloader'](directory)
157-
except KeyError:
157+
except KeyError: # pragma: no cover
158158
raise Exception("We don't support downloading font '{name}'".format(
159159
name=icon_font)
160160
)

icon_font_to_png/icon_font_downloader.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ class IconFontDownloader(with_metaclass(ABCMeta)):
2121
@abstractmethod
2222
def css_url(self):
2323
"""Icon font CSS file URL"""
24-
pass
2524

2625
@property
2726
@abstractmethod
2827
def ttf_url(self):
2928
"""Icon font TTF file URL"""
30-
pass
3129

3230
def __init__(self, directory=None):
3331
"""
@@ -64,7 +62,6 @@ def _get_latest_tag_from_github(repo_api_url):
6462
@abstractmethod
6563
def get_latest_version_number(self):
6664
"""Get latest icon font version number"""
67-
pass
6865

6966
def download_css(self, directory):
7067
"""Downloads icon font CSS file and returns its path"""

icon_font_to_png/test/test_command_line.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ def test_icon_export(capfd):
4747
css_file = os.path.join('files', 'font-awesome.css')
4848
ttf_file = os.path.join('files', 'fontawesome-webfont.ttf')
4949

50+
# Export none icons
51+
with pytest.raises(SystemExit):
52+
command_line.run(
53+
'--css {css_file} --ttf {ttf_file}'.format(
54+
css_file=css_file, ttf_file=ttf_file
55+
).split()
56+
)
57+
out, err = capfd.readouterr() # For skipping stdout
58+
5059
# Export one icon
5160
command_line.run(
5261
'--css {css_file} --ttf {ttf_file} github'.format(

0 commit comments

Comments
 (0)