class CapAdd(BaseTranslator):
    def translate(self, value): class CapDrop(BaseTranslator):
    def translate(self, value): class ContainerName(BaseTranslator):
    def translate(self, value): class CpuShares(BaseTranslator):
    def translate(self, value): class Cpuset(BaseTranslator):
    def translate(self, value): class Devices(BaseTranslator):
    def translate(self, value): class Dns(BaseTranslator):
    def translate(self, value): class DnsSearch(BaseTranslator):
    def translate(self, value): class Entrypoint(BaseTranslator):
    def translate(self, value): class EnvFile(BaseTranslator):
    def translate(self, value): class Environment(BaseTranslator):
    def translate(self, value): class Expose(BaseTranslator):
    def translate(self, value): class Hostname(BaseTranslator):
    def translate(self, value): class Labels(BaseTranslator):
    def translate(self, value): class Links(BaseTranslator):
    def translate(self, value): class LogDriver(BaseTranslator):
    def translate(self, value): class MacAddress(BaseTranslator):
    def translate(self, value): class MemLimit(BaseTranslator):
    def translate(self, value): class MemswapLimit(BaseTranslator):
    def translate(self, value): class Net(BaseTranslator):
    def translate(self, value): class Pid(BaseTranslator):
    def translate(self, value): class Ports(BaseTranslator):
    def translate(self, value): class Privileged(BaseTranslator):
    def translate(self, value): class ReadOnly(BaseTranslator):
    def translate(self, value): class Restart(BaseTranslator):
    def translate(self, value): class StdinOpen(BaseTranslator):
    def translate(self, value): class Tty(BaseTranslator):
    def translate(self, value): class User(BaseTranslator):
    def translate(self, value): class VolumeDriver(BaseTranslator):
    def translate(self, value): class Volumes(BaseTranslator):
    def translate(self, value): class VolumesFrom(BaseTranslator):
    def translate(self, value): class WorkingDir(BaseTranslator):
    def translate(self, value):
import six
import unittest
from traductor.translators import (cap_add, cap_drop, container_name, cpu_shares, cpuset, devices,
    dns, dns_search, entrypoint, env_file, environment, expose, hostname, labels, links,
    log_driver, mac_address, mem_limit, memswap_limit, net, pid, ports, privileged, read_only,
    restart, stdin_open, tty, user, volume_driver, volumes, volumes_from, working_dir)
            "SESSION_SECRET": "",
        }
        expected_output="--env=RACK_ENV:development --env=SESSION_SECRET:"

        output=environment.Environment().translate(input)

        self.assertTrue(output, expected_output)

    def test_coversion_with_list(self):

        input=["RACK_ENV=development", "SESSION_SECRET"]
        expected_output="--env=RACK_ENV:development --env=SESSION_SECRET:"

        output=environment.Environment().translate(input)

        self.assertEqual(output, expected_output)

    def test_coversion_fail(self):

        input=""
        expected_output=""

        output=environment.Environment().translate(input)

        self.assertEqual(output, expected_output)



class TestExpose(unittest.TestCase):

    def test_coversion(self):

        input=["3000", "8000"]
        expected_output="--expose=3000 --expose=8000"

        output=expose.Expose().translate(input)

        self.assertEqual(output, expected_output)

    def test_coversion_fail(self):

        input=""
        expected_output=""

        output=expose.Expose().translate(input)

        self.assertEqual(output, expected_output)



class TestHostname(unittest.TestCase):

    def test_coversion(self):

        input="foo"
        expected_output="--hostname=foo"

        output=hostname.Hostname().translate(input)

        self.assertEqual(output, expected_output)

    def test_coversion_fail(self):

        input=""
        expected_output=""

        output=hostname.Hostname().translate(input)

        self.assertEqual(output, expected_output)



class TestLabels(unittest.TestCase):

    def test_coversion_with_dict(self):

        input={
            "com.example.description": "Accounting webapp",
            "com.example.department": "Finance",
            "com.example.label-with-empty-value": "",
        }
        expected_output="--label=com.example.description:Accounting webapp " \
                        "--label=com.example.department:Finance --label=com.example.label-with-empty-value:"

        output=labels.Labels().translate(input)

        self.assertTrue(output, expected_output)

    def test_coversion_with_list(self):

        input=[
            "com.example.description=Accounting webapp",
            "com.example.department=Finance",
            "com.example.label-with-empty-value",
        ]
        expected_output="--label=com.example.description:Accounting webapp " \
                        "--label=com.example.department:Finance --label=com.example.label-with-empty-value:"

        output=labels.Labels().translate(input)

        self.assertEqual(output, expected_output)

    def test_coversion_fail(self):

        input=""
        expected_output=""

        output=labels.Labels().translate(input)

        self.assertEqual(output, expected_output)



class TestLinks(unittest.TestCase):

    def test_coversion(self):

        input=["db", "db:database", "redis"]
        expected_output="--link=db --link=db:database --link=redis"


        output=links.Links().translate(input)