image_test.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 PKG = 'dockeros'
3 # from dockeros.image import DockeROSImage
4 
5 import docker
6 import subprocess
7 import sys
8 import unittest
9 
10 TEST_IMAGES = ["rosrun_move_base_move_base"]
11 
12 class TestLib(unittest.TestCase):
13  def _clean(self):
14  for img in TEST_IMAGES:
15  try:
16  self.client.images.remove(img)
17  except Exception:
18  pass
19 
20  def setUp(self):
21  self.client = docker.from_env()
22  self._clean()
23 
25  dri = DockeROSImage(["rosrun", "move_base", "move_base"], {})
26  dri.make_client()
27  dri.build()
28  img = self.client.images.get(dri.name)
29 
30  def tearDown(self):
31  self._clean()
32 
33 
34 class TestCLI(unittest.TestCase):
35  def test_getting_help(self):
36  # out = subprocess.check_output(
37  # " ".join(
38  # ["dockeros", "-h"]),
39  # shell=True)
40  # print(out)
41  self.assertEquals(1, 1, "1!=1")
42 
43 
44 if __name__ == '__main__':
45  import rostest
46  # rostest.rosrun(PKG, 'test_lib', TestLib)
47  rostest.rosrun(PKG, 'test_cli', TestCLI)
def _clean(self)
Definition: image_test.py:13
def tearDown(self)
Definition: image_test.py:30
def setUp(self)
Definition: image_test.py:20
def test_getting_help(self)
Definition: image_test.py:35
def test_build_move_base_image(self)
Definition: image_test.py:24


dockeros
Author(s):
autogenerated on Mon Dec 9 2019 21:17:31