import unittest

import scrubadub

from base import BaseTestCase


class NameTestCase(unittest.TestCase, BaseTestCase):

    def test_john(self):
        """
        BEFORE: John is a cat
        AFTER:  {{NAME}} is a cat
        """
        self.compare_before_after()

    def test_no_names(self):
        """
        BEFORE: Hello. Please testing.
        AFTER: Hello. Please testing.
        """
        self.compare_before_after()

    @unittest.skip('lower names cause problems for textblob')
    def test_lower_names(self):
        """
        BEFORE: sarah is a friendly person
        AFTER: {{NAME}} is a friendly person
        """
        self.compare_before_after()

@@ -59,16 +59,33 @@
 stCase%0A%0A
+import scrubadub%0A
 %0Aclass N
@@ -670,28 +670,260 @@
 self.compare_before_after()%0A
+%0A    def test_disallowed_nouns(self):%0A        detector = scrubadub.detectors.NameDetector()%0A        detector.disallowed_nouns = set()%0A        with self.assertRaises(TypeError):%0A            list(detector.iter_filth('John is a cat'))%0A

test for invalid disallowed_nouns in name detector