Esempio n. 1
0
 def test_unpack_complex(self):
     raw = "(hello,hi|world)"
     result = unpack(raw)
     expected = (
         "hello,hi",
         "world",
     )
     self.assertEqual(expected, result)
Esempio n. 2
0
 def test_unpack(self):
     raw = "(hello|world)"
     result = unpack(raw)
     expected = (
         "hello",
         "world",
     )
     self.assertEqual(expected, result)
Esempio n. 3
0
def load_dict(f):
    for l in f:
        yield set(
            map(
                lambda x: tuple(map(clean, x)),
                map(
                    lambda x: set(
                        [line for line in x.split(",") if len(line) > 0]),
                    unpack(l))))
Esempio n. 4
0
 def test_unpack_complex(self):
     raw = "(hello,hi|world)"
     result = unpack(raw)
     expected = ("hello,hi", "world")
     self.assertEqual(expected, result)
Esempio n. 5
0
 def test_unpack_on_default(self):
     raw = "hello"
     result = unpack(raw)
     self.assertEqual(("hello",), result)
Esempio n. 6
0
 def test_unpack(self):
     raw = "(hello|world)"
     result = unpack(raw)
     expected = ("hello", "world")
     self.assertEqual(expected, result)
Esempio n. 7
0
def load_dict(f):
    for l in f:
        yield set(map(lambda x: tuple(map(clean, x)), map(lambda x: set([line for line in x.split(",") if len(line) > 0]), unpack(l))))
Esempio n. 8
0
 def test_unpack_on_default(self):
     raw = "hello"
     result = unpack(raw)
     self.assertEqual(("hello", ), result)