Esempio n. 1
0
def test_itxt_compressed():
	chunk_type, data = make_text_chunk(type="iTXt", value=u"SOME TEXT", compression_flag=1)
	assert chunk_type == "iTXt"
	assert data == make_chunk(
		"iTXt",
		b"Comment\0\1\0\0\0" +
			zlib.compress(u"SOME TEXT".encode("utf-8")))
Esempio n. 2
0
def test_itxt_compressed():
    chunk_type, data = make_text_chunk(type="iTXt",
                                       value=u"SOME TEXT",
                                       compression_flag=1)
    assert chunk_type == "iTXt"
    assert data == make_chunk(
        "iTXt",
        b"Comment\0\1\0\0\0" + zlib.compress(u"SOME TEXT".encode("utf-8")))
Esempio n. 3
0
	def test_itxt_compressed(self):
		import zlib
		from apng import make_text_chunk, make_chunk
		chunk_type, data = make_text_chunk(type="iTXt", value=u"SOME TEXT", compression_flag=1)
		self.assertEqual(chunk_type, "iTXt")
		self.assertEqual(
			data,
			make_chunk(
				"iTXt",
				b"Comment\0\1\0\0\0" +
					zlib.compress(u"SOME TEXT".encode("utf-8"))
			)
		)
Esempio n. 4
0
def test_ztxt():
	chunk_type, data = make_text_chunk(type="zTXt", value="some text")
	assert chunk_type == "zTXt"
	assert data == make_chunk("zTXt", b"Comment\0\0" + zlib.compress(b"some text"))
Esempio n. 5
0
def test_text():
	chunk_type, data = make_text_chunk(value="some text")
	assert chunk_type == "tEXt"
	assert data == make_chunk("tEXt", b"Comment\0some text")
Esempio n. 6
0
def test_itxt():
	chunk_type, data = make_text_chunk(type="iTXt", value=u"SOME TEXT")
	assert chunk_type == "iTXt"
	assert data == make_chunk("iTXt", b"Comment\0\0\0\0\0" + u"SOME TEXT".encode("utf-8"))
Esempio n. 7
0
	def test_itxt(self):
		from apng import make_text_chunk, make_chunk
		chunk_type, data = make_text_chunk(type="iTXt", value=u"SOME TEXT")
		self.assertEqual(chunk_type, "iTXt")
		self.assertEqual(data, make_chunk("iTXt", b"Comment\0\0\0\0\0" + u"SOME TEXT".encode("utf-8")))
Esempio n. 8
0
	def test_ztxt(self):
		import zlib
		from apng import make_text_chunk, make_chunk
		chunk_type, data = make_text_chunk(type="zTXt", value="some text")
		self.assertEqual(chunk_type, "zTXt")
		self.assertEqual(data, make_chunk("zTXt", b"Comment\0\0" + zlib.compress(b"some text")))
Esempio n. 9
0
	def test_text(self):
		from apng import make_text_chunk, make_chunk
		chunk_type, data = make_text_chunk(value="some text")
		self.assertEqual(chunk_type, "tEXt")
		self.assertEqual(data, make_chunk("tEXt", b"Comment\0some text"))
Esempio n. 10
0
def test_text():
    chunk_type, data = make_text_chunk(value="some text")
    assert chunk_type == "tEXt"
    assert data == make_chunk("tEXt", b"Comment\0some text")
Esempio n. 11
0
def test_itxt():
    chunk_type, data = make_text_chunk(type="iTXt", value=u"SOME TEXT")
    assert chunk_type == "iTXt"
    assert data == make_chunk(
        "iTXt", b"Comment\0\0\0\0\0" + u"SOME TEXT".encode("utf-8"))
Esempio n. 12
0
def test_ztxt():
    chunk_type, data = make_text_chunk(type="zTXt", value="some text")
    assert chunk_type == "zTXt"
    assert data == make_chunk("zTXt",
                              b"Comment\0\0" + zlib.compress(b"some text"))