예제 #1
0
 def test_ensure_list_returns_lists(self):
     l = ["a", "b", "c", "d"]
     e = ["a", "b", "c", "d"]
     self.assertEqual(e, curator.ensure_list(l))
     l = "abcd"
     e = ["abcd"]
     self.assertEqual(e, curator.ensure_list(l))
     l = [["abcd", "defg"], 1, 2, 3]
     e = [["abcd", "defg"], 1, 2, 3]
     self.assertEqual(e, curator.ensure_list(l))
     l = {"a": "b", "c": "d"}
     e = [{"a": "b", "c": "d"}]
     self.assertEqual(e, curator.ensure_list(l))
예제 #2
0
 def test_ensure_list_returns_lists(self):
     l = ["a", "b", "c", "d"]
     e = ["a", "b", "c", "d"]
     self.assertEqual(e, curator.ensure_list(l))
     l = "abcd"
     e = ["abcd"]
     self.assertEqual(e, curator.ensure_list(l))
     l = [["abcd","defg"], 1, 2, 3]
     e = [["abcd","defg"], 1, 2, 3]
     self.assertEqual(e, curator.ensure_list(l))
     l = {"a":"b", "c":"d"}
     e = [{"a":"b", "c":"d"}]
     self.assertEqual(e, curator.ensure_list(l))