[pep8] make test files and config files pep8 valid

Signed-off-by: akoskaaa <akos.hochrein@prezi.com>
This commit is contained in:
akoskaaa 2015-03-25 20:13:01 -07:00
parent 9aab7bc242
commit f9ea5ecf40
13 changed files with 66 additions and 66 deletions

View File

@ -35,6 +35,7 @@ install_requires = [
'six >= 1.3.0, < 2',
]
tests_require = [
'mock >= 1.0.1',
'nose',

View File

@ -4,4 +4,3 @@ if sys.version_info >= (2,7):
import unittest
else:
import unittest2 as unittest

View File

@ -187,7 +187,6 @@ class ServiceTest(DockerClientTestCase):
service.recreate_containers()
self.assertEqual(len(service.containers(stopped=True)), 1)
def test_recreate_containers_with_image_declared_volume(self):
service = Service(
project='composetest',
@ -229,8 +228,7 @@ class ServiceTest(DockerClientTestCase):
set([
'composetest_db_1', 'db_1',
'composetest_db_2', 'db_2',
'db',
]),
'db'])
)
def test_start_container_creates_links_with_names(self):
@ -246,8 +244,7 @@ class ServiceTest(DockerClientTestCase):
set([
'composetest_db_1', 'db_1',
'composetest_db_2', 'db_2',
'custom_link_name',
]),
'custom_link_name'])
)
def test_start_container_with_external_links(self):
@ -291,8 +288,7 @@ class ServiceTest(DockerClientTestCase):
set([
'composetest_db_1', 'db_1',
'composetest_db_2', 'db_2',
'db',
]),
'db'])
)
def test_start_container_builds_images(self):

View File

@ -151,4 +151,3 @@ def make_files(dirname, filenames):
for fname in filenames:
with open(os.path.join(dirname, fname), 'w') as f:
f.write('')

View File

@ -4,6 +4,7 @@ from .. import unittest
from compose import config
class ConfigTest(unittest.TestCase):
def test_from_dictionary(self):
service_dicts = config.from_dictionary({
@ -114,8 +115,7 @@ class EnvTest(unittest.TestCase):
os.environ['ENV_DEF'] = 'E3'
service_dict = config.make_service_dict(
'foo',
{
'foo', {
'environment': {
'FILE_DEF': 'F1',
'FILE_DEF_EMPTY': '',
@ -174,6 +174,7 @@ class EnvTest(unittest.TestCase):
{'FILE_DEF': 'F1', 'FILE_DEF_EMPTY': '', 'ENV_DEF': 'E3', 'NO_DEF': ''},
)
class ExtendsTest(unittest.TestCase):
def test_extends(self):
service_dicts = config.load('tests/fixtures/extends/docker-compose.yml')
@ -231,7 +232,6 @@ class ExtendsTest(unittest.TestCase):
],
)
def test_extends_validation(self):
dictionary = {'extends': None}
load_config = lambda: config.make_service_dict('myweb', dictionary, working_dir='tests/fixtures/extends')

View File

@ -9,7 +9,6 @@ from compose.container import Container
class ContainerTest(unittest.TestCase):
def setUp(self):
self.container_dict = {
"Id": "abc",
@ -30,7 +29,9 @@ class ContainerTest(unittest.TestCase):
container = Container.from_ps(None,
self.container_dict,
has_been_inspected=True)
self.assertEqual(container.dictionary, {
self.assertEqual(
container.dictionary,
{
"Id": "abc",
"Image": "busybox:latest",
"Name": "/composetest_db_1",
@ -122,10 +123,10 @@ class ContainerTest(unittest.TestCase):
container = Container(None, {
"Status": "Up 8 seconds",
"HostConfig": {
"VolumesFrom": ["volume_id",]
"VolumesFrom": ["volume_id"]
},
}, has_been_inspected=True)
self.assertEqual(container.get('Status'), "Up 8 seconds")
self.assertEqual(container.get('HostConfig.VolumesFrom'), ["volume_id",])
self.assertEqual(container.get('HostConfig.VolumesFrom'), ["volume_id"])
self.assertEqual(container.get('Foo.Bar.DoesNotExist'), None)

View File

@ -8,6 +8,7 @@ from compose import config
import mock
import docker
class ProjectTest(unittest.TestCase):
def test_from_dict(self):
project = Project.from_dicts('composetest', [

View File

@ -165,7 +165,8 @@ class ServiceTest(unittest.TestCase):
self.assertFalse('domainname' in opts, 'domainname')
def test_split_domainname_fqdn(self):
service = Service('foo',
service = Service(
'foo',
hostname='name.domain.tld',
client=self.mock_client)
self.mock_client.containers.return_value = []
@ -174,7 +175,8 @@ class ServiceTest(unittest.TestCase):
self.assertEqual(opts['domainname'], 'domain.tld', 'domainname')
def test_split_domainname_both(self):
service = Service('foo',
service = Service(
'foo',
hostname='name',
domainname='domain.tld',
client=self.mock_client)
@ -184,7 +186,8 @@ class ServiceTest(unittest.TestCase):
self.assertEqual(opts['domainname'], 'domain.tld', 'domainname')
def test_split_domainname_weird(self):
service = Service('foo',
service = Service(
'foo',
hostname='name.sub',
domainname='domain.tld',
client=self.mock_client)
@ -315,4 +318,3 @@ class ServiceVolumesTest(unittest.TestCase):
self.assertEqual(
binding,
('/home/user', dict(bind='/home/user', ro=False)))

View File

@ -3,6 +3,7 @@ from __future__ import absolute_import
from compose.cli.utils import split_buffer
from .. import unittest
class SplitBufferTest(unittest.TestCase):
def test_single_line_chunks(self):
def reader():