예제 #1
0
    def testCase(self):
        s = "Hello, World"
        a = glyph.blob(s)
        b = glyph.parse(glyph.dump(a))

        self.assertEqual(s, b.fh.read())

        s = "Hello, World"
        a = glyph.blob(BytesIO(s))
        b = glyph.parse(glyph.dump(a))

        self.assertEqual(s, b.fh.read())
예제 #2
0
    def testCase(self):
        s = "Hello, World"
        a = glyph.blob(s)
        b = glyph.parse(glyph.dump(a))

        self.assertEqual(s, b.fh.read())

        s = "Hello, World"
        a = glyph.blob(BytesIO(s))
        b = glyph.parse(glyph.dump(a))

        self.assertEqual(s, b.fh.read())
예제 #3
0
 def testCase(self):
     cases = [
         glyph.form("http://example.org",values=['a','b']),
         glyph.link("http://toot.org")
     ]
     for c in cases:
         self.assertEqual(c, glyph.parse(glyph.dump(c)))
예제 #4
0
 def testCase(self):
     cases = [
         glyph.form("http://example.org", values=['a', 'b']),
         glyph.link("http://toot.org")
     ]
     for c in cases:
         self.assertEqual(c, glyph.parse(glyph.dump(c)))
예제 #5
0
 def testCase(self):
     cases = [
         1,
         1.0,
         "foo",
         u"bar",
         [],
         ['a',1,[2]],
         collections.OrderedDict([('a', 1), ('b',2)]),
         None,
         True,
         False,
         {'a':1},
         set([1,2,3]),
         glyph.utcnow(),
         datetime.timedelta(days=5, hours=4, minutes=3, seconds=2),
     ]
     for c in cases:
         self.assertEqual(c, glyph.parse(glyph.dump(c)))
예제 #6
0
 def testCase(self):
     cases = [
         1,
         1.0,
         "foo",
         u"bar",
         [],
         ['a', 1, [2]],
         collections.OrderedDict([('a', 1), ('b', 2)]),
         None,
         True,
         False,
         {
             'a': 1
         },
         set([1, 2, 3]),
         glyph.utcnow(),
         datetime.timedelta(days=5, hours=4, minutes=3, seconds=2),
     ]
     for c in cases:
         self.assertEqual(c, glyph.parse(glyph.dump(c)))