Skip to content
Snippets Groups Projects
Commit 6e8f3dbb authored by Ladislav Lhotka's avatar Ladislav Lhotka
Browse files

Add test module for pytest.

parent 8c2fb1b9
Branches
Tags
No related merge requests found
.cache
*.pyc
bin
docs/_build
......
from yangson.module.parser import Parser
class TestParser:
text = """module test { // Nice module
prefix t;
namespace /* URI follows */ \t'http://example.com/test';
leaf foo {
type string;
default "hi \\"doc\\"";
}
leaf bar {
mandatory true;
type uint8;
}
}
"""
def test_parser(self):
p = Parser(self.text)
s = p.parse_module()
ss = s.find_all("leaf")
sss1 = ss[0].find1("default")
sss2 = ss[1].find1("type", "uint8")
assert sss1.keyword == "default"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment