Ejemplo n.º 1
0
class UnparsedEntryTests(TestCase, EntryTestsMixin):
    """
    Tests for L{UnparsedEntry}
    """
    def setUp(self):
        """
        Set up the 'entry' to be an unparsed entry for some random text.
        """
        self.entry = UnparsedEntry("    This is a bogus entry.  \n")

    def test_fromString(self):
        """
        Creating an L{UnparsedEntry} should simply record the string it was
        passed.
        """
        self.assertEqual("    This is a bogus entry.  \n", self.entry._string)

    def test_matchesHost(self):
        """
        An unparsed entry can't match any hosts.
        """
        self.assertFalse(self.entry.matchesHost("www.twistedmatrix.com"))

    def test_matchesKey(self):
        """
        An unparsed entry can't match any keys.
        """
        self.assertFalse(self.entry.matchesKey(Key.fromString(sampleKey)))

    def test_toString(self):
        """
        L{UnparsedEntry.toString} returns its input string, sans trailing
        newline.
        """
        self.assertEqual("    This is a bogus entry.  ", self.entry.toString())
Ejemplo n.º 2
0
class UnparsedEntryTests(TestCase, EntryTestsMixin):
    """
    Tests for L{UnparsedEntry}
    """
    def setUp(self):
        """
        Set up the 'entry' to be an unparsed entry for some random text.
        """
        self.entry = UnparsedEntry("    This is a bogus entry.  \n")


    def test_fromString(self):
        """
        Creating an L{UnparsedEntry} should simply record the string it was
        passed.
        """
        self.assertEqual("    This is a bogus entry.  \n",
                         self.entry._string)


    def test_matchesHost(self):
        """
        An unparsed entry can't match any hosts.
        """
        self.assertEqual(False, self.entry.matchesHost("www.twistedmatrix.com"))


    def test_matchesKey(self):
        """
        An unparsed entry can't match any keys.
        """
        self.assertEqual(False, self.entry.matchesKey(Key.fromString(sampleKey)))


    def test_toString(self):
        """
        L{UnparsedEntry.toString} returns its input string, sans trailing
        newline.
        """
        self.assertEqual("    This is a bogus entry.  ", self.entry.toString())
Ejemplo n.º 3
0
 def setUp(self):
     """
     Set up the 'entry' to be an unparsed entry for some random text.
     """
     self.entry = UnparsedEntry("    This is a bogus entry.  \n")
Ejemplo n.º 4
0
 def setUp(self):
     """
     Set up the 'entry' to be an unparsed entry for some random text.
     """
     self.entry = UnparsedEntry("    This is a bogus entry.  \n")