summaryrefslogtreecommitdiffstats
path: root/tests/units/client.py
blob: 4e780a7a507f00eadbfb7d8f73bc34f84c540ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import subprocess
import os

class Client():

    def __init__(self):
        self.null = open(os.devnull, 'wb')
        self.proc = subprocess.Popen(['python3', 'main.py'],
                                     cwd='../',
                                     stdout=self.null,
                                     stderr=self.null)

    def stop(self):
        self.proc.terminate()
        self.proc.kill()
        self.proc.wait()
        self.null.close()