source: ogClient-Git/tests/units/client.py @ bd98dd1

Last change on this file since bd98dd1 was 0ada33c, checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago

rename main.py to ogclient

  • Property mode set to 100644
File size: 713 bytes
Line 
1#
2# Copyright (C) 2020 Soleta Networks <info@soleta.eu>
3#
4# This program is free software: you can redistribute it and/or modify it under
5# the terms of the GNU Affero General Public License as published by the
6# Free Software Foundation, version 3.
7#
8
9import subprocess
10import os
11
12class Client():
13
14    def __init__(self):
15        self.null = open(os.devnull, 'wb')
16        self.proc = subprocess.Popen(['python3', 'ogclient'],
17                                     cwd='../',
18                                     stdout=self.null,
19                                     stderr=self.null)
20
21    def stop(self):
22        self.proc.terminate()
23        self.proc.kill()
24        self.proc.wait()
25        self.null.close()
Note: See TracBrowser for help on using the repository browser.