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())
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())
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")