Moved tests to root directory
This commit is contained in:
parent
5c5bb9a02f
commit
772585109d
5 changed files with 1 additions and 1 deletions
31
tests/testcases.py
Normal file
31
tests/testcases.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from docker import Client
|
||||
from plum.service import Service
|
||||
import os
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
class DockerClientTestCase(TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
if os.environ.get('DOCKER_URL'):
|
||||
cls.client = Client(os.environ['DOCKER_URL'])
|
||||
else:
|
||||
cls.client = Client()
|
||||
cls.client.pull('ubuntu')
|
||||
|
||||
def setUp(self):
|
||||
for c in self.client.containers(all=True):
|
||||
self.client.kill(c['Id'])
|
||||
self.client.remove_container(c['Id'])
|
||||
|
||||
def create_service(self, name, **kwargs):
|
||||
return Service(
|
||||
name=name,
|
||||
client=self.client,
|
||||
image="ubuntu",
|
||||
command=["/bin/sleep", "300"],
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue