Code Duplication    Length = 17-17 lines in 2 locations

unitest-restful.py 1 location

@@ 53-69 (lines=17) @@
50
                               headers={'Accept-encoding': 'identity'})
51
        return ret
52
53
    def test_000_start_server(self):
54
        """Start the Glances Web Server."""
55
        global pid
56
57
        print('INFO: [TEST_000] Start the Glances Web Server')
58
        if os.path.isfile("./venv/bin/python"):
59
            cmdline = "./venv/bin/python"
60
        else:
61
            cmdline = "python"
62
        cmdline += " -m glances -B localhost -w -p %s" % SERVER_PORT
63
        print("Run the Glances Web Server on port %s" % SERVER_PORT)
64
        args = shlex.split(cmdline)
65
        pid = subprocess.Popen(args)
66
        print("Please wait 5 seconds...")
67
        time.sleep(5)
68
69
        self.assertTrue(pid is not None)
70
71
    def test_001_all(self):
72
        """All."""

unitest-xmlrpc.py 1 location

@@ 42-58 (lines=17) @@
39
        """The function is called *every time* before test_*."""
40
        print('\n' + '=' * 78)
41
42
    def test_000_start_server(self):
43
        """Start the Glances Web Server."""
44
        global pid
45
46
        print('INFO: [TEST_000] Start the Glances Web Server')
47
        if os.path.isfile("./venv/bin/python"):
48
            cmdline = "./venv/bin/python"
49
        else:
50
            cmdline = "python"
51
        cmdline += " -m glances -B localhost -s -p %s" % SERVER_PORT
52
        print("Run the Glances Server on port %s" % SERVER_PORT)
53
        args = shlex.split(cmdline)
54
        pid = subprocess.Popen(args)
55
        print("Please wait...")
56
        time.sleep(1)
57
58
        self.assertTrue(pid is not None)
59
60
    def test_001_all(self):
61
        """All."""