8000 Renames parse_param_type -> parse_type · illusional/python-cwlgen@379fb3d · GitHub
[go: up one dir, main page]

Skip to content

Commit 379fb3d

Browse files
committed
Renames parse_param_type -> parse_type
1 parent 863e04d commit 379fb3d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/test_unit_typing.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
import unittest
2-
from cwlgen.elements import parse_param_type, NON_NULL_CWL_TYPE, CWL_TYPE, DEF_TYPE, CommandInputArraySchema
2+
from cwlgen.elements import parse_type, NON_NULL_CWL_TYPE, CWL_TYPE, DEF_TYPE, CommandInputArraySchema
33
import logging
44

55

66
class TestParamTyping(unittest.TestCase):
77

88
def test_types(self):
99
for cwl_type in NON_NULL_CWL_TYPE:
10-
self.assertEqual(parse_param_type(cwl_type), cwl_type)
10+
self.assertEqual(parse_type(cwl_type), cwl_type)
1111

1212
def test_incorrect_type(self):
1313
invalid_type = "invalid"
14-
should_be_def_type = parse_param_type(invalid_type)
14+
should_be_def_type = parse_type(invalid_type)
1515
self.assertNotEqual(should_be_def_type, invalid_type)
1616
self.assertEqual(should_be_def_type, DEF_TYPE)
1717

1818
def test_optional_string(self):
1919
for cwl_type in NON_NULL_CWL_TYPE:
2020
optional_type = cwl_type + "?"
21-
self.assertEqual(parse_param_type(optional_type), optional_type)
21+
self.assertEqual(parse_type(optional_type), optional_type)
2222

2323
def test_typed_array(self):
2424
array_string_type = "string[]"
25-
q = parse_param_type(array_string_type)
25+
q = parse_type(array_string_type)
2626
self.assertIsInstance(q, CommandInputArraySchema)
2727
self.assertEqual(q.items, "string")
2828

2929
def test_incorrectly_typed_array(self):
3030
array_string_type = "invalid[]"
31-
q = parse_param_type(array_string_type)
31+
q = parse_type(array_string_type)
3232
self.assertIsInstance(q, CommandInputArraySchema)
3333
self.assertNotEqual(q.items, "invalid")
3434
self.assertEqual(q.items, DEF_TYPE)
3535

3636
def test_optionally_typed_array(self):
3737
array_string_type = "string?[]"
38-
q = parse_param_type(array_string_type)
38+
q = parse_type(array_string_type)
3939
self.assertIsInstance(q, CommandInputArraySchema)
4040
self.assertEqual(q.items, "string?")
4141

4242
def test_optional_typed_array(self):
4343
optional_array_string_type = "string[]?"
44-
q = parse_param_type(optional_array_string_type)
44+
q = parse_type(optional_array_string_type)
4545
self.assertIsInstance(q, list)
4646
self.assertEqual(len(q), 2)
4747
null_idx = q.index(DEF_TYPE)
@@ -52,11 +52,11 @@ def test_optional_typed_array(self):
5252
def test_command_input_array_schema(self):
5353
ar = CommandInputArraySchema(items="string")
5454
self.assertIsInstance(ar, CommandInputArraySchema)
55-
self.assertEqual(parse_param_type(ar), ar)
55+
self.assertEqual(parse_type(ar), ar)
5656
self.assertEqual(ar.items, "string")
5757

5858
def test_optional_type_input_array_schema(self):
5959
ar = CommandInputArraySchema(items="string?")
6060
self.assertIsInstance(ar, CommandInputArraySchema)
61-
self.assertEqual(parse_param_type(ar), ar)
61+
self.assertEqual(parse_type(ar), ar)
6262
self.assertEqual(ar.items, "string?")

0 commit comments

Comments
 (0)
0