Skip to content

Commit 9487538

Browse files
committed
add failing tests for file path bug (issue #3); @Phantom-code
1 parent 5bc8e7c commit 9487538

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

tests/test_commands.py

-13
This file was deleted.

tests/test_filepaths.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import sys
5+
import pytest
6+
7+
from fontline.commands import get_linegap_percent_filepath
8+
9+
test_filepath_one = "test.ttf"
10+
test_filepath_two = "./test.ttf"
11+
test_filepath_three = "/dir1/dir2/test.ttf"
12+
test_filepath_four = "~/dir1/dir2/test.ttf"
13+
percent_value = "10"
14+
15+
16+
def test_linegap_outfile_filepath_basename():
17+
response = get_linegap_percent_filepath(test_filepath_one, percent_value)
18+
assert response == "test-linegap10.ttf"
19+
20+
21+
def test_linegap_outfile_filepath_samedir_withdotsyntax():
22+
response = get_linegap_percent_filepath(test_filepath_two, percent_value)
23+
assert response == "./test-linegap10.ttf"
24+
25+
26+
def test_linegap_outfile_filepath_differentdir_fromroot():
27+
response = get_linegap_percent_filepath(test_filepath_three, percent_value)
28+
assert response == "/dir1/dir2/test-linegap10.ttf"
29+
30+
31+
def test_linegap_outfile_filepath_differentdir_fromuser():
32+
response = get_linegap_percent_filepath(test_filepath_four, percent_value)
33+
assert response == "~/dir1/dir2/test-linegap10.ttf"
34+

0 commit comments

Comments
 (0)