diff --git a/capirca/lib/ciscoasa.py b/capirca/lib/ciscoasa.py index 6bd14e0c..6e394c1b 100644 --- a/capirca/lib/ciscoasa.py +++ b/capirca/lib/ciscoasa.py @@ -100,7 +100,7 @@ def __str__(self): for line in self.term.verbatim: if line[0] == 'ciscoasa': ret_str.append(str(line[1])) - return '\n'.join(ret_str) + return '\n'.join(ret_str) # protocol if not self.term.protocol: diff --git a/tests/lib/ciscoasa_test.py b/tests/lib/ciscoasa_test.py index fb9b4852..c1b16479 100644 --- a/tests/lib/ciscoasa_test.py +++ b/tests/lib/ciscoasa_test.py @@ -43,6 +43,13 @@ policer:: batman } """ +GOOD_TERM_3 = """ +term good-term-3 { + verbatim:: ciscoasa "asa had a little lamb" + verbatim:: ciscoasa "asa had a second lamb" + verbatim:: ciscoasa "asa had a third lamb" +} +""" SUPPORTED_TOKENS = { 'action', @@ -139,6 +146,12 @@ def testBuildWarningTokens(self): self.assertEqual(st, SUPPORTED_TOKENS) self.assertEqual(sst, SUPPORTED_SUB_TOKENS) + def testVerbatimTerm(self): + pol1 = ciscoasa.CiscoASA(policy.ParsePolicy(GOOD_HEADER + GOOD_TERM_3, + self.naming), EXP_INFO) + self.assertIn("asa had a little lamb", str(pol1), str(pol1)) + self.assertIn("asa had a second lamb", str(pol1), str(pol1)) + self.assertIn("asa had a third lamb", str(pol1), str(pol1)) if __name__ == '__main__': absltest.main()