Skip to content

Commit 3c46595

Browse files
committed
[test] add case
#43
1 parent fe8c95f commit 3c46595

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

pyswagger/tests/test_getter.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pyswagger import SwaggerApp
2+
from pyswagger.getter import UrlGetter
23
from .utils import get_test_data_folder
34
import unittest
45
import os
@@ -26,5 +27,19 @@ def test_random_name_v1_2(self):
2627
which='random_file_name'
2728
)
2829
path = os.path.join(path, 'test_random.json')
29-
# should not raise ValueError
30+
# should not raise ValueError
3031
app = SwaggerApp.create(path)
32+
33+
def test_local_path_with_custome_getter(self):
34+
""" make sure path would be assigned when
35+
passing a getter class
36+
"""
37+
cls = UrlGetter
38+
path = get_test_data_folder(
39+
version='2.0',
40+
which='random_file_name'
41+
)
42+
path = os.path.join(path, 'test_random.json')
43+
44+
# should not raise errors
45+
app = SwaggerApp.load(path, getter=cls)

0 commit comments

Comments
 (0)