File: parse.py

package info (click to toggle)
knot-resolver 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,392 kB
  • sloc: javascript: 42,732; ansic: 40,312; python: 12,616; cpp: 2,121; sh: 1,997; xml: 193; makefile: 181
file content (21 lines) | stat: -rw-r--r-- 434 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Returns 0 if the test is parsed, 1 if not."""

import sys
import os
import argparse
import pydnstest
import pydnstest.scenario


def main():
    """Returns 0 if the test is parsed, 1 if not."""
    argparser = argparse.ArgumentParser()
    argparser.add_argument("file")
    args = argparser.parse_args()
    if pydnstest.scenario.parse_file(os.path.realpath(args.file)):
        sys.exit(0)
    else:
        sys.exit(1)


main()