summaryrefslogtreecommitdiffstats
path: root/tests/units/client.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-01-16 11:33:26 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commitbb65bd7bf03da7ad5a9ae25d6caab57d06211b99 (patch)
tree03f12a9e7b8e12a4ff3ea9efa20969ac0b693935 /tests/units/client.py
parent0c5cbee301db4be515fd9224f93c026857976488 (diff)
Add unit testing basic structure
Diffstat (limited to 'tests/units/client.py')
-rw-r--r--tests/units/client.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/units/client.py b/tests/units/client.py
new file mode 100644
index 0000000..4e780a7
--- /dev/null
+++ b/tests/units/client.py
@@ -0,0 +1,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()