docstr: Tests successful docker login returns True and calls docker appropriately
docstr_tok: ["Tests","successful","docker","login","returns","True","and","calls","docker","appropriately"]
code: def test_docker_login_success(self, mock_run):
      """
      Tests successful docker login returns True and calls docker appropriately
      """
      mock_session, stub = mock_boto()
      stub.activate()
      with patch("boto3.Session", return_value=mock_session):
          mock_process = MagicMock(
              auto_spec=subprocess.Popen, name="mock_process"
          )
  
          # Simulate successful login
          mock_process.returncode = 0
          mock_run.return_value = mock_process
  
          login_dockerhub(
              SECRET_NAME, SECRET_ENDPOINT_URL, SECRET_ENDPOINT_REGION
          )
  
          # Check boto client is properly created
          print(mock_session.client.call_args_list)
          assert mock_session.client.call_args_list == [
              call(
                  service_name="secretsmanager",
                  region_name="us-east-2",
                  endpoint_url="https://endpoint.url",
              )
          ]
  
          # Check that login call passes in the password in the correct way
          assert mock_run.call_args_list == [
              call(
                  [
                      "docker",
                      "login",
                      "--username",
                      "myuser",
                      "--password-stdin",
                  ],
                  stdout=subprocess.PIPE,
                  input=str.encode("mypass"),
              )
          ]
      stub.deactivate()
  
file_path: mxnet/ci/test_docker_login.py
imports: import os
  import subprocess
  import unittest
  from unittest.mock import create_autospec, patch, call, MagicMock
  import boto3
  from boto3 import client
  from botocore.stub import Stubber
  from docker_login import login_dockerhub, logout_dockerhub, main, DOCKERHUB_RETRY_SECONDS, DOCKERHUB_LOGIN_NUM_RETRIES
label_desc: Use image node_id 1 for calling the TestDockerLogin obj's underlying member method code with example usage: obj.test_docker_login_success(mock_run) without return types