X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-json.py;h=d9f0bfe6df5c1614bab27e01d443b62032f0cb55;hb=c5cf10598f8c9f4428291e9df3ecd72a05fb1ccf;hp=bffb88a03b54202970581c2df5bec49ab91f24d0;hpb=991559357f6a03c3a5b70c053c8c2554aa8d5ee4;p=sliver-openvswitch.git diff --git a/tests/test-json.py b/tests/test-json.py index bffb88a03..d9f0bfe6d 100644 --- a/tests/test-json.py +++ b/tests/test-json.py @@ -1,11 +1,11 @@ -# Copyright (c) 2009, 2010 Nicira Networks. -# +# Copyright (c) 2009, 2010 Nicira, Inc. +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,6 +18,7 @@ import sys import ovs.json + def print_json(json): if type(json) in [str, unicode]: print "error: %s" % json @@ -27,6 +28,7 @@ def print_json(json): sys.stdout.write("\n") return True + def parse_multiple(stream): buf = stream.read(4096) ok = True @@ -49,6 +51,7 @@ def parse_multiple(stream): ok = False return ok + def main(argv): argv0 = argv[0] @@ -88,5 +91,6 @@ def main(argv): if not ok: sys.exit(1) + if __name__ == '__main__': main(sys.argv)