def post(self): message = json.loads(self.request.body) logging.error(message) subject = message['message_data']['subject'] subject = tagRemover.remove_tags(subject) # Remove the tags rawBody = message['message_data']['body'][0]['content'] rawBody = tagRemover.remove_tags(rawBody) # Remove the tags dbMessage = Message(subject = subject, body = rawBody) #process # - normalize the email - # removings tags # - check for duplicates dbMessage.put()
def test_big_real_message_1(self): toProcess = samples.BIG_STRING_1INIT expected = samples.BIG_STRING_1FINAL self.assertEquals(tagRemover.remove_tags(toProcess), expected)
def test_big_real_message_2(self): toProcess = samples.BIG_STRING_2INIT expected = samples.BIG_STRING_2FINAL print "This is the next message that needs addressing..." print tagRemover.remove_tags(toProcess)
def test_3(self): toProcess = "pooop " expected = "pooop " self.assertEquals(tagRemover.remove_tags(toProcess), expected)
def test_2(self): toProcess = "<hello> <goodbye>" expected = " " self.assertEquals(tagRemover.remove_tags(toProcess), expected)
def test_1(self): toProcess = '<h1>Title</h1><p>This is a<a href="http://www.udacity.com">link</a>.<p>' expected = " Title This is a link . " self.assertEquals(tagRemover.remove_tags(toProcess), expected)
def test_string_with_no_tags_1(self): noTags = "pooop and poop and stuff " self.assertEquals(tagRemover.remove_tags(noTags), noTags)
def test_empty_string(self): empty = "" self.assertEquals(tagRemover.remove_tags(empty), empty)