示例#1
0
 def test_empty(self):
     assert settings.list_of_str(None) == []
     assert settings.list_of_str('') == []
示例#2
0
 def test_non_str_raises_error(self):
     with pytest.raises(AssertionError):
         settings.list_of_str([1, 2, 3])
示例#3
0
 def test_non_sequence_raises_error(self):
     with pytest.raises(AssertionError):
         settings.list_of_str(1)
示例#4
0
 def test_multiple_strings(self):
     assert settings.list_of_str('abc,def,ghi') == ['abc', 'def', 'ghi']
示例#5
0
 def test_one_string(self):
     assert settings.list_of_str('abc') == ['abc']
示例#6
0
 def test_handles_sequences(self):
     assert settings.list_of_str(['abc']) == ['abc']
     assert settings.list_of_str(('abc', )) == ['abc']
     assert settings.list_of_str([val for val in 'abc']) == ['a', 'b', 'c']