|
4 | 4 | import os |
5 | 5 | import tempfile |
6 | 6 |
|
7 | | -from icon_font_to_png import icon_font_downloader |
| 7 | +from icon_font_to_png.icon_font_downloader import ( |
| 8 | + FontAwesomeDownloader, OcticonsDownloader |
| 9 | +) |
8 | 10 |
|
9 | 11 |
|
10 | 12 | # Font Awesome |
11 | 13 | def test_font_awesome(): |
12 | 14 | """Test initializing Font Awesome Downloader""" |
13 | 15 | # With directory |
14 | | - obj = icon_font_downloader.FontAwesomeDownloader(tempfile.mkdtemp()) |
| 16 | + obj = FontAwesomeDownloader(tempfile.mkdtemp()) |
15 | 17 | obj.download_files() |
16 | 18 |
|
17 | 19 | assert os.path.isfile(obj.css_path) |
18 | 20 | assert os.path.isfile(obj.ttf_path) |
19 | 21 |
|
20 | 22 | # Without directory |
21 | | - obj = icon_font_downloader.FontAwesomeDownloader() |
| 23 | + obj = FontAwesomeDownloader() |
22 | 24 | obj.download_files() |
23 | 25 |
|
24 | 26 | assert os.path.isfile(obj.css_path) |
25 | 27 | assert os.path.isfile(obj.ttf_path) |
26 | 28 |
|
27 | 29 |
|
| 30 | +def test_font_awesome_latest_version_number(): |
| 31 | + """Test that getting latest version number""" |
| 32 | + obj = FontAwesomeDownloader(tempfile.mkdtemp()) |
| 33 | + assert obj.get_latest_version_number() |
| 34 | + |
| 35 | + |
28 | 36 | # Octicons |
29 | 37 | def test_octicons(): |
30 | 38 | """Test initializing Octicons Downloader""" |
31 | 39 | # With directory |
32 | | - obj = icon_font_downloader.OcticonsDownloader(tempfile.mkdtemp()) |
| 40 | + obj = OcticonsDownloader(tempfile.mkdtemp()) |
33 | 41 | obj.download_files() |
34 | 42 |
|
35 | 43 | assert os.path.isfile(obj.css_path) |
36 | 44 | assert os.path.isfile(obj.ttf_path) |
37 | 45 |
|
38 | 46 | # Without directory |
39 | | - obj = icon_font_downloader.OcticonsDownloader() |
| 47 | + obj = OcticonsDownloader() |
40 | 48 | obj.download_files() |
41 | 49 |
|
42 | 50 | assert os.path.isfile(obj.css_path) |
43 | 51 | assert os.path.isfile(obj.ttf_path) |
| 52 | + |
| 53 | + |
| 54 | +def test_octicons_latest_version_number(): |
| 55 | + """Test that getting latest version number""" |
| 56 | + obj = OcticonsDownloader(tempfile.mkdtemp()) |
| 57 | + assert obj.get_latest_version_number() |
0 commit comments