예제 #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']