'Test that calling scale on a service that has a custom container name
results in warning output.'

@mock.patch(u'compose.service.log')
def test_scale_with_custom_container_name_outputs_warning(self, mock_log):

    service = self.create_service(u'app', container_name=u'custom-container')
    self.assertEqual(service.custom_container_name, u'custom-container')
    with pytest.raises(OperationFailedError):
        service.scale(3)
    captured_output = mock_log.warn.call_args[0][0]
    self.assertEqual(len(service.containers()), 1)
    self.assertIn(u'Remove    the    custom    name    to    scale    the    service.', captured_output)
