def test_batch_compute_node_user(self, batch_pool, **kwargs):
        client = self.create_sharedkey_client(**kwargs)
        nodes = list(client.compute_node.list(batch_pool.name))
        while self.is_live and any([n for n in nodes if n.state != models.ComputeNodeState.idle]):
            time.sleep(10)
            nodes = list(client.compute_node.list(batch_pool.name))

        # Test Add User
        user_name = 'BatchPythonSDKUser'
        nodes = list(client.compute_node.list(batch_pool.name))
        user = models.ComputeNodeUser(user_name, password='******', is_admin=False)
        response = client.compute_node.add_user(batch_pool.name, nodes[0].id, user)
        self.assertIsNone(response)

        # Test Update User
        user = models.NodeUpdateUserParameter(password='******')
        response = client.compute_node.update_user(batch_pool.name, nodes[0].id, user_name, user)
        self.assertIsNone(response)

        # Test Get RDP File
        file_length = 0
        with io.BytesIO() as file_handle:
            response = client.compute_node.get_remote_desktop(batch_pool.name, nodes[0].id)
            if response:
                for data in response:
                    file_length += len(data)
        self.assertTrue(file_length > 0)

        # Test Delete User
        response = client.compute_node.delete_user(batch_pool.name, nodes[0].id, user_name)
        self.assertIsNone(response)
    def test_batch_compute_node_user(self, batch_pool, **kwargs):
        client = self.create_sharedkey_client(**kwargs)
        nodes = list(client.compute_node.list(batch_pool.name))
        while self.is_live and any([n for n in nodes if n.state != models.ComputeNodeState.idle]):
            time.sleep(10)
            nodes = list(client.compute_node.list(batch_pool.name))
        self.assertEqual(len(nodes), 1)

        # Test Add User
        user_name = 'BatchPythonSDKUser'
        nodes = list(client.compute_node.list(batch_pool.name))
        user = models.ComputeNodeUser(name=user_name, password='******', is_admin=False)
        response = client.compute_node.add_user(batch_pool.name, nodes[0].id, user)
        self.assertIsNone(response)

        # Test Update User
        user = models.NodeUpdateUserParameter(password='******')
        response = client.compute_node.update_user(batch_pool.name, nodes[0].id, user_name, user)
        self.assertIsNone(response)

        # Test Get remote login settings
        remote_login_settings = client.compute_node.get_remote_login_settings(batch_pool.name, nodes[0].id)
        self.assertIsInstance(remote_login_settings, models.ComputeNodeGetRemoteLoginSettingsResult)
        self.assertIsNotNone(remote_login_settings.remote_login_ip_address)
        self.assertIsNotNone(remote_login_settings.remote_login_port)

        # Test Delete User
        response = client.compute_node.delete_user(batch_pool.name, nodes[0].id, user_name)
        self.assertIsNone(response)