"""
Unit tests for the portion of this project which processes raw text using
natural language processing techniques.
"""

import sys
import unittest

from os import path

# PATH MAGIC
# Project root
base = path.abspath(path.join(path.dirname(path.abspath(__file__)), ".."))
sys.path.insert(0, base)

from SocialNPHS.language import tweet
from SocialNPHS.sources.twitter import user


class testLanguage(unittest.TestCase):
    words = "@1Defenestrator is really awesome! Although, @G4_Y5_3X is cooler."

    def test_tweet_tagging(self):
        # Test that tagging works in its most basic form
        moshe = user.NPUser("G4_Y5_3X")
        tags = tweet.get_tweet_tags(moshe.tweepy.status.text)
        self.assertIsInstance(tags, list)
        # Test that names are replaced and recognized as proper nouns
        tags = tweet.get_tweet_tags(self.words)
        self.assertEqual(tags[0][0], "Luke Taylor")
        self.assertEqual(tags[0][1], "NNP")

    def test_tweet_analysis(self):
        # Test that basic sentiment analysis works
        self.assertEqual(
            tweet.tweet_connotation(self.words)['compound'],
            0.345
        )
        self.assertEqual(
            tweet.person_connotation(self.words, 'Luke Taylor')['neu'],
            0.461
        )

@@ -425,16 +425,50 @@
     
-words
+def setUp(self):%0A        self.sentence
  = 
+(
 %22@1D
@@ -509,16 +509,44 @@
 though, 
+%22%0A                         %22
 @G4_Y5_3
@@ -558,16 +558,17 @@
 cooler.%22
+)
 %0A%0A    de
@@ -907,21 +907,24 @@
 gs(self.
-words
+sentence
 )%0A      
@@ -1167,21 +1167,24 @@
 on(self.
-words
+sentence
 )%5B'compo
@@ -1290,13 +1290,16 @@
 elf.
-words
+sentence
 , 'L

Make the test sentence used in language tests an instance attribute