def _init_parser(self, cpts): self.parser = Parser(cpts, grammar) self.namespace = '' self._anon = {}
from nose.tools import * import sys sys.path.append('..') from lcapy.parser import Parser import lcapy.schemcpts as schemcpts import lcapy.grammar as grammar parser = Parser(schemcpts, grammar) parse = parser.parse @raises(ValueError) def test_Exception1(): '''Test missing arg''' parse('V1 2') @raises(ValueError) def test_Exception2(): '''Test too many args''' parse('V1 2 3 4 5 6') @raises(ValueError) def test_Exception3(): '''Test too many args''' parse('V1 2 3 dc 4 5 6') @raises(ValueError) def test_Exception4():
def _init_parser(self, cpts): self.parser = Parser(cpts, grammar) # Current namespace self.namespace = '' self.subnetlists = {} self._anon = {}