4d0bfe9f8ea7d868ce309c96e939ce309b93b1c8,naive_bayes/tests/test_plain_text_email.py,TestPlaintextEmailObject,setUp,#TestPlaintextEmailObject#,11

Before Change


        self.plain_file = "./tests/fixtures/plain.eml"
        self.plaintext = io.open(self.plain_file, "r")
        self.text = self.plaintext.read()
        self.plaintext.seek(0)
        self.plain_email = EmailObject(self.plaintext)

    def test_parse_plain_body(self):
        body = self.CLRF.join(self.text.split(self.CLRF)[1:])

After Change



    def setUp(self):
        self.plain_file = "./tests/fixtures/plain.eml"
        with io.open(self.plain_file, "rb") as plaintext:
            self.text = plaintext.read()
            plaintext.seek(0)
            self.plain_email = EmailObject(plaintext)

    def test_parse_plain_body(self):
        body = self.CLRF.join(self.text.split(self.CLRF)[1:])
        self.assertEqual(self.plain_email.body(), body)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: thoughtfulml/examples-in-python
Commit Name: 4d0bfe9f8ea7d868ce309c96e939ce309b93b1c8
Time: 2017-06-13
Author: alexey.porotnikov@gmail.com
File Name: naive_bayes/tests/test_plain_text_email.py
Class Name: TestPlaintextEmailObject
Method Name: setUp


Project Name: biocore/scikit-bio
Commit Name: 3a1eb421e538d56db4e30b65c38d6221e066aa78
Time: 2014-05-11
Author: mcdonadt@colorado.edu
File Name: skbio/core/tests/test_distance.py
Class Name: DissimilarityMatrixTests
Method Name: test_from_file_real_file


Project Name: biocore/scikit-bio
Commit Name: 325199b76f0e2914e54077130104be45bbccea76
Time: 2014-04-16
Author: jorgecanardo@gmail.com
File Name: skbio/core/tests/test_distance.py
Class Name: DissimilarityMatrixTests
Method Name: test_from_file_real_file