summaryrefslogtreecommitdiff
path: root/project2/proj2_s4498062/dns_tests.py
blob: 71e56605275e81d02b551ed197bff40bda5ed62a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python2
""" Tests for your DNS resolver and server """

import sys
import unittest


port = 5353
server = "localhost"


class TestResolver(unittest.TestCase):
    """Unit tests for the resolver"""
    pass


class TestResolverCache(unittest.TestCase):
    """Unit tests for the resolver cache"""
    pass


class TestServer(unittest.TestCase):
    """Unit tests for the server"""
    pass


def main():
    """Run the tests"""
    # Parse command line arguments
    import argparse
    parser = argparse.ArgumentParser(description="HTTP Tests")
    parser.add_argument("-s", "--server", type=str, default="localhost")
    parser.add_argument("-p", "--port", type=int, default=5001)
    args, extra = parser.parse_known_args()
    port = args.port
    server = args.server

    # Pass the extra arguments to unittest
    sys.argv[1:] = extra

    # Start test suite
    unittest.main()

if __name__ == "__main__":
    main()