Skip to content

Commit

Permalink
Wow, Python 3.3 sucks.
Browse files Browse the repository at this point in the history
  • Loading branch information
amcgregor committed Feb 13, 2016
1 parent ada6b1d commit 7eb3bf8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import re
import time
import pytest
import base64

from unittest import TestCase
from email.header import Header
Expand Down Expand Up @@ -196,7 +197,7 @@ def test_mime_embed_gif_file(self):
message.rich = "Farewell cruel world."

with tempfile.NamedTemporaryFile() as fh:
fh.write(codecs.decode(self.gif, 'base64'))
fh.write(base64.b64decode(self.gif))
fh.flush()

message.embed(fh.name)
Expand All @@ -212,7 +213,7 @@ def test_mime_embed_gif_bytes(self):
message = self.build_message()
message.plain = "Hello world."
message.rich = "Farewell cruel world."
message.embed('test.gif', bytes(codecs.decode(self.gif, 'base64')))
message.embed('test.gif', base64.b64decode(self.gif))

result = bytes(message)

Expand All @@ -221,7 +222,7 @@ def test_mime_embed_gif_bytes(self):

class Mock(object):
def read(s):
return codecs.decode(self.gif, 'base64')
return base64.b64decode(self.gif)

message = self.build_message()
message.plain = "Hello world."
Expand Down

0 comments on commit 7eb3bf8

Please sign in to comment.