Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build/templates/_converters.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nidcpower/nidcpower/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nidigital/nidigital/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nidmm/nidmm/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nifake/nifake/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 6 additions & 0 deletions generated/nifake/nifake/unit_tests/test_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,9 @@ def test_convert_comma_separated_string_to_list():
def test_convert_list_to_comma_separated_string():
out_string = _converters.convert_list_to_comma_separated_string(['PinA', 'PinB', 'PinC'])
assert out_string == 'PinA,PinB,PinC'


def test_convert_list_to_comma_separated_string_invalid_input():
with pytest.raises(TypeError) as error_info:
_converters.convert_list_to_comma_separated_string('PinA,PinB,PinC')
assert str(error_info.value) == 'Input must be a list or tuple of str'
6 changes: 4 additions & 2 deletions generated/nifgen/nifgen/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nimodinst/nimodinst/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nirfsg/nirfsg/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/niscope/niscope/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nise/nise/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/niswitch/niswitch/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 4 additions & 2 deletions generated/nitclk/nitclk/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ def convert_comma_separated_string_to_list(comma_separated_string):


def convert_list_to_comma_separated_string(list_of_strings):
'''Convert a list of strings into a comma-separated string.
'''Convert a list or tuple of strings into a comma-separated string.

Args:
list_of_strings (list[str]): List of strings.
list_of_strings (list or tuple of str): List or tuple of strings.

Returns:
str: Comma-separated string.
'''
if not isinstance(list_of_strings, (list, tuple)) or not all(isinstance(item, str) for item in list_of_strings):
raise TypeError('Input must be a list or tuple of str')
return ','.join(list_of_strings)


Expand Down
6 changes: 6 additions & 0 deletions src/nifake/unit_tests/test_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,9 @@ def test_convert_comma_separated_string_to_list():
def test_convert_list_to_comma_separated_string():
out_string = _converters.convert_list_to_comma_separated_string(['PinA', 'PinB', 'PinC'])
assert out_string == 'PinA,PinB,PinC'


def test_convert_list_to_comma_separated_string_invalid_input():
with pytest.raises(TypeError) as error_info:
_converters.convert_list_to_comma_separated_string('PinA,PinB,PinC')
assert str(error_info.value) == 'Input must be a list or tuple of str'