Permalink
Browse files

Added travis configurations

cleaned up test code
  • Loading branch information...
1 parent 611e8c4 commit 3ffe360d4601fa9d641123fabf50c62ce8fa2f28 @roycehaynes roycehaynes committed Nov 11, 2012
View
@@ -0,0 +1,4 @@
+language: python
+python:
+ - "2.7"
+script: python setup.py test
View
@@ -1,5 +1,7 @@
# Email Reply Parser for Python
+[![Build Status](https://secure.travis-ci.org/zapier/django-drip.png)](http://travis-ci.org/zapier/email_reply_parser)
+
## Summary
Email Reply Parser is a port of GitHub's Email Reply Parser library, making it easy to fragment email.
@@ -12,16 +14,14 @@ pip install email_reply_parser
## Tutorial
-To use email_reply_parser,
+How to parse an email message:
Step 1: import package
-Ex.: from email_reply_parser import EmailReplyParser
+from email_reply_parser import EmailReplyParser
Step 2: Pass in email message as type String
-Ex.: EmailReplyParser.read(text)
-
+EmailReplyParser.read(text)
-## Contribute
View
No changes.
@@ -0,0 +1,43 @@
+Metadata-Version: 1.0
+Name: email-reply-parser
+Version: 0.1.0
+Summary: Port of GitHub's Email Reply Parser
+Home-page: https://github.com/zapier/email-reply-parser
+Author: Royce Haynes
+Author-email: royce.haynes@gmail.com
+License: Copyright (c) 2012 Zapier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+Description: # Email Reply Parser for Python
+
+ [![Build Status](https://secure.travis-ci.org/zapier/django-drip.png)](http://travis-ci.org/zapier/email_reply_parser)
+
+ ## Summary
+
+ Email Reply Parser is a port of GitHub's Email Reply Parser library, making it easy to fragment email.
+
+ ## Installation
+
+ Using pip, use command:
+
+ pip install email_reply_parser
+
+ ## Tutorial
+
+ How to parse an email message:
+
+ Step 1: import package
+
+ from email_reply_parser import EmailReplyParser
+
+ Step 2: Pass in email message as type String
+
+ EmailReplyParser.read(text)
+
+
+
+Platform: UNKNOWN
@@ -0,0 +1,8 @@
+setup.py
+email_reply_parser.egg-info/PKG-INFO
+email_reply_parser.egg-info/SOURCES.txt
+email_reply_parser.egg-info/dependency_links.txt
+email_reply_parser.egg-info/top_level.txt
+tests/__init__.py
+tests/context.py
+tests/test_email_message.py
@@ -0,0 +1 @@
+
@@ -0,0 +1 @@
+tests
View
@@ -17,5 +17,6 @@
author_email='royce.haynes@gmail.com',
url='https://github.com/zapier/email-reply-parser',
license=license,
- packages=find_packages(exclude=('tests', 'docs'))
+ packages=find_packages(exclude=('tests')),
+ test_suite='tests.test_email_message'
)
@@ -83,17 +83,17 @@ def test_reply_is_parsed(self):
self.assertTrue("You can list the keys for the bucket" in message.reply)
def test_sent_from_iphone(self):
- with open('emails/email_iPhone.txt') as email:
+ with open('tests/emails/email_iPhone.txt') as email:
self.assertTrue("Sent from my iPhone" not in EmailReplyParser.parse_reply(email.read()))
def test_email_one_is_not_on(self):
- with open('emails/email_one_is_not_on.txt') as email:
+ with open('tests/emails/email_one_is_not_on.txt') as email:
self.assertTrue("On Oct 1, 2012, at 11:55 PM, Dave Tapley wrote:" not in EmailReplyParser.parse_reply(email.read()))
def get_email(self, name):
""" Return EmailMessage instance
"""
- text = open('emails/%s.txt' % name).read()
+ text = open('tests/emails/%s.txt' % name).read()
return EmailReplyParser.read(text)

0 comments on commit 3ffe360

Please sign in to comment.