Skip to content

Commit 007c79c

Browse files
committed
modifying no-diff and delta testop when no(postnodes) > no(prenodes)
1 parent e4860a7 commit 007c79c

File tree

7 files changed

+105
-54
lines changed

7 files changed

+105
-54
lines changed

docs/images/Jsnapy.png

100644100755
File mode changed.

lib/jnpr/jsnapy/samples/module_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Performing function similar to --check in command line ###
1+
### Performing function similar to --check in command line ###
22
from jnpr.jsnapy import SnapAdmin
33
from pprint import pprint
44
from jnpr.junos import Device

lib/jnpr/jsnapy/samples/module_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
config_data = """
99
hosts:
1010
- device: 10.209.16.204
11-
username : demo
11+
username : demo
1212
passwd: demo123
1313
tests:
1414
- test_exists.yml

lib/jnpr/jsnapy/samples/module_device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
js = SnapAdmin()
1010
config_file = "/etc/jsnapy/testfiles/config_check.yml"
1111

12-
### can pass device object
13-
### it will not create new connection with device
12+
# can pass device object
13+
# it will not create new connection with device
1414
snapchk = js.snapcheck(config_file, "snap", dev=dev_obj)
1515

1616
for val in snapchk:

lib/jnpr/jsnapy/samples/module_snapcheck.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,3 @@
1515
print "Total passed: ", snapcheck.no_passed
1616
print "Total failed:", snapcheck.no_failed
1717
pprint(dict(snapcheck.test_details))
18-
19-

lib/jnpr/jsnapy/testop.py

Lines changed: 99 additions & 46 deletions
Large diffs are not rendered by default.

tools/jsnap2py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ else:
4747
# loop = Group(OneOrMore(Word(alphanums + '-' + '/'+'['+']'+"'"+'='))) + \
4848
# Suppress(Literal("{"))
4949
loop = Group(Word(alphanums) + (OneOrMore(Word(alphanums + '-' + '/' +
50-
'[' + ']' + "'" + '='))).setParseAction(lambda tokens: " ".join(tokens))) + Suppress(Literal("{"))
50+
'[' + ']' + "'" + '='))).setParseAction(lambda tokens: " ".join(tokens))) + Suppress(Literal("{"))
5151
tc_id = Group(ZeroOrMore(Group('id' +
5252
(ZeroOrMore('.') +
5353
ZeroOrMore('/') +
@@ -82,7 +82,7 @@ else:
8282
msg = nestedExpr(opener='{', closer='}')
8383
comment = Keyword('#') + SkipTo(LineEnd())
8484
test_case = tcs + OneOrMore(Group(tc_name + cmd + ZeroOrMore(Group(loop + tc_id + Group(OneOrMore(Group(oper + msg)))) +
85-
Suppress(ZeroOrMore(Literal("}")))) + Suppress(ZeroOrMore(Literal("}")))) + Suppress(ZeroOrMore(comment)))
85+
Suppress(ZeroOrMore(Literal("}")))) + Suppress(ZeroOrMore(Literal("}")))) + Suppress(ZeroOrMore(comment)))
8686
data = test_case.parseString(content, parseAll=True).asList()
8787
push = {'tests_include': data[0]}
8888
for cases in data[1:]:

0 commit comments

Comments
 (0)