'Testing a get'

@mock.patch('oc_adm_manage_node.Utils.create_tmpfile_copy')
@mock.patch('oc_adm_manage_node.ManageNode.openshift_cmd')
def test_list_pods(self, mock_openshift_cmd, mock_tmpfile_copy):

    params = {'node': ['ip-172-31-49-140.ec2.internal'], 'schedulable': None, 'selector': None, 'pod_selector': None, 'list_pods': True, 'kubeconfig': '/etc/origin/master/admin.kubeconfig', 'evacuate': False, 'grace_period': False, 'dry_run': False, 'force': False}
    pod_list = '{\n                "metadata":    {},\n                "items":    [\n                                {\n                                                "metadata":    {\n                                                                "name":    "docker-registry-1-xuhik",\n                                                                "generateName":    "docker-registry-1-",\n                                                                "namespace":    "default",\n                                                                "selfLink":    "/api/v1/namespaces/default/pods/docker-registry-1-xuhik",\n                                                                "uid":    "ae2a25a2-e316-11e6-80eb-0ecdc51fcfc4",\n                                                                "resourceVersion":    "1501",\n                                                                "creationTimestamp":    "2017-01-25T15:55:23Z",\n                                                                "labels":    {\n                                                                                "deployment":    "docker-registry-1",\n                                                                                "deploymentconfig":    "docker-registry",\n                                                                                "docker-registry":    "default"\n                                                                },\n                                                                "annotations":    {\n                                                                                "openshift.io/deployment-config.latest-version":    "1",\n                                                                                "openshift.io/deployment-config.name":    "docker-registry",\n                                                                                "openshift.io/deployment.name":    "docker-registry-1",\n                                                                                "openshift.io/scc":    "restricted"\n                                                                }\n                                                },\n                                                "spec":    {}\n                                },\n                                {\n                                                "metadata":    {\n                                                                "name":    "router-1-kp3m3",\n                                                                "generateName":    "router-1-",\n                                                                "namespace":    "default",\n                                                                "selfLink":    "/api/v1/namespaces/default/pods/router-1-kp3m3",\n                                                                "uid":    "9e71f4a5-e316-11e6-80eb-0ecdc51fcfc4",\n                                                                "resourceVersion":    "1456",\n                                                                "creationTimestamp":    "2017-01-25T15:54:56Z",\n                                                                "labels":    {\n                                                                                "deployment":    "router-1",\n                                                                                "deploymentconfig":    "router",\n                                                                                "router":    "router"\n                                                                },\n                                                                "annotations":    {\n                                                                                "openshift.io/deployment-config.latest-version":    "1",\n                                                                                "openshift.io/deployment-config.name":    "router",\n                                                                                "openshift.io/deployment.name":    "router-1",\n                                                                                "openshift.io/scc":    "hostnetwork"\n                                                                }\n                                                },\n                                                "spec":    {}\n                                }]\n}'
    mock_openshift_cmd.side_effect = [{'cmd': '/usr/bin/oadm    manage-node    ip-172-31-49-140.ec2.internal    --list-pods', 'results': pod_list, 'returncode': 0}]
    mock_tmpfile_copy.side_effect = ['/tmp/mocked_kubeconfig']
    results = ManageNode.run_ansible(params, False)
    self.assertTrue((len(results['results']['nodes']) == 1))
    self.assertTrue((len(results['results']['nodes']['ip-172-31-49-140.ec2.internal']) == 2))
