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())
def testCase(self): root = glyph.get(self.endpoint.url) b = glyph.blob(BytesIO("TEST"), content_type="Test") b2 = root.do_blob(b) self.assertEqual(b2.fh.read(), "test") self.assertEqual(b2.content_type, "Test")
def do_blob(self, b): s = b.fh.read() c = b.content_type return glyph.blob(BytesIO(s.lower()), content_type=c)