Juniper/jsnapy

How to test a string that contains a colon ?

sophoah opened this issue · 2 comments

Description of Issue/Question

Not really an issue but more a howto or enhancement if that is not available.

I want to test an output that would contain a colon ie ":"

Setup

(Please provide relevant configs, xml snapshots and related files (Be sure to remove sensitive info).)

  • command: show route 0.0.0.0
    tests:
  • contains: as-path, AS path: 12345 I

Steps to Reproduce Issue

(Include debug logs if possible and relevant. Error trace would be helpful too)
use the above snippet test code, the : is part of the string to be tested and jsnapy will complain with : yaml.scanner.ScannerError: mapping values are not allowed here
in "test_file.yml", line 10, column 35

Versions Report

(Provided by running jsnapy --version. Please also mention python version.)
jsnapy version: 1.3.2
python 2.7.5

@sophoah Can you try below syntax

- contains: "as-path, AS path: 12345"

Hi Nitin, wonderful, that worked like a charm ! thanks for the answer !