def test_get_container_create_options_does_not_mutate_options(self):
    labels = {'thing': 'real'}
    environment = {'also': 'real'}
    service = Service('foo', image='foo', labels=dict(labels), client=self.mock_client, environment=dict(environment))
    self.mock_client.inspect_image.return_value = {'Id': 'abcd'}
    prev_container = mock.Mock(id='ababab', image_config={'ContainerConfig': {}})
    prev_container.get.return_value = None
    opts = service._get_container_create_options({}, 1, previous_container=prev_container)
    assert (service.options['labels'] == labels)
    assert (service.options['environment'] == environment)
    assert (opts['labels'][LABEL_CONFIG_HASH] == 'EXAMPLE_KEY')
    assert (opts['environment'] == ['also=real'])
def test_get_container_create_options_does_not_mutate_options(self):
    labels = {'thing': 'real'}
    environment = {'also': 'real'}
    service = Service('foo', image='foo', labels=dict(labels), client=self.mock_client, environment=dict(environment))
    self.mock_client.inspect_image.return_value = {'Id': 'abcd'}
    prev_container = mock.Mock(id='ababab', image_config={'ContainerConfig': {}})
    prev_container.get.return_value = None
    opts = service._get_container_create_options({}, 1, previous_container=prev_container)
    assert (service.options['labels'] == labels)
    assert (service.options['environment'] == environment)
    assert (opts['labels'][LABEL_CONFIG_HASH] == 'EXAMPLE_KEY')
    assert (opts['environment'] == ['also=real'])