# Path: ddsc/sdk/dukeds.py
# class DukeDS(object):
# class Session(object):
#     def list_projects():
#     def create_project(name, description):
#     def delete_project(project_name):
#     def is_project_consistent(project_name):
#     def wait_for_project_consistency(project_name, wait_sec=5):
#     def create_folder(project_name, remote_path):
#     def list_files(project_name):
#     def download_file(project_name, remote_path, local_path=None):
#     def move_file_or_folder(project_name, source_remote_path, target_remote_path):
#     def upload_file(project_name, local_path, remote_path=None):
#     def delete_file(project_name, remote_path):
#     def can_deliver_to_user_with_email(email_address, logging_func=logging.info):
#     def can_deliver_to_user_with_username(username, logging_func=logging.info):
#     def __init__(self, config=None):
#     def list_projects(self):
#     def create_project(self, name, description):
#     def delete_project(self, project_name):
#     def create_folder(self, project_name, remote_path):
#     def list_files(self, project_name):
#     def download_file(self, project_name, remote_path, local_path=None):
#     def upload_file(self, project_name, local_path, remote_path=None):
#     def _get_or_create_project(self, project_name):
#     def _cache_project_list_once(self):
#     def clear_project_cache(self):
#     def _get_project_for_name(self, project_name):
#     def _get_file_path_dict_for_project(project):
#     def delete_file(self, project_name, remote_path):
#     def can_deliver_to_user_with_email(self, email_address, logging_func):
#     def can_deliver_to_user_with_username(self, username, logging_func):
#     def move_file_or_folder(self, project_name, source_remote_path, target_remote_path):
#     def is_project_consistent(self, project_name):
#     def wait_for_project_consistency(self, project_name, wait_sec=5):


from unittest import TestCase
from ddsc import DukeDS, ItemNotFound, DuplicateNameError, Session
from mock import patch, Mock, ANY
        dds_user_util = mock_user_util.return_value
        dds_user_util.user_or_affiliate_exists_for_email.assert_called_with("fakeuser@duke.edu")
        self.assertEqual(result, dds_user_util.user_or_affiliate_exists_for_email.return_value)

    @patch('ddsc.sdk.dukeds.Client')
    @patch('ddsc.sdk.dukeds.UserUtil')
    def test_can_deliver_to_user_with_email_with_logging_func(self, mock_user_util, mock_client):
        mock_log_func = Mock()
        result = DukeDS.can_deliver_to_user_with_email(email_address='fakeuser@duke.edu', logging_func=mock_log_func)
        mock_user_util.assert_called_with(mock_client.return_value.dds_connection.data_service,
                                          logging_func=mock_log_func)
        dds_user_util = mock_user_util.return_value
        dds_user_util.user_or_affiliate_exists_for_email.assert_called_with("fakeuser@duke.edu")
        self.assertEqual(result, dds_user_util.user_or_affiliate_exists_for_email.return_value)

    @patch('ddsc.sdk.dukeds.Client')
    @patch('ddsc.sdk.dukeds.UserUtil')
    def test_can_deliver_to_user_with_username(self, mock_user_util, mock_client):
        result = DukeDS.can_deliver_to_user_with_username(username='fakeuser')
        mock_user_util.assert_called_with(mock_client.return_value.dds_connection.data_service, logging_func=ANY)
        dds_user_util = mock_user_util.return_value
        dds_user_util.user_or_affiliate_exists_for_username.assert_called_with("fakeuser")
        self.assertEqual(result, dds_user_util.user_or_affiliate_exists_for_username.return_value)

    @patch('ddsc.sdk.dukeds.Client')
    @patch('ddsc.sdk.dukeds.UserUtil')
    def test_can_deliver_to_user_with_username_with_logging_func(self, mock_user_util, mock_client):
        mock_log_func = Mock()
        result = DukeDS.can_deliver_to_user_with_username(username='fakeuser', logging_func=mock_log_func)
        mock_user_util.assert_called_with(mock_client.return_value.dds_connection.data_service,

# Path: ddsc/sdk/dukeds.py
# class DukeDS(object):
# class Session(object):
#     def list_projects():
#     def create_project(name, description):
#     def delete_project(project_name):
#     def is_project_consistent(project_name):
#     def wait_for_project_consistency(project_name, wait_sec=5):
#     def create_folder(project_name, remote_path):
#     def list_files(project_name):
#     def download_file(project_name, remote_path, local_path=None):
#     def move_file_or_folder(project_name, source_remote_path, target_remote_path):
#     def upload_file(project_name, local_path, remote_path=None):
#     def delete_file(project_name, remote_path):
#     def can_deliver_to_user_with_email(email_address, logging_func=logging.info):
#     def can_deliver_to_user_with_username(username, logging_func=logging.info):
#     def __init__(self, config=None):
#     def list_projects(self):
#     def create_project(self, name, description):
#     def delete_project(self, project_name):
#     def create_folder(self, project_name, remote_path):
#     def list_files(self, project_name):
#     def download_file(self, project_name, remote_path, local_path=None):
#     def upload_file(self, project_name, local_path, remote_path=None):
#     def _get_or_create_project(self, project_name):
#     def _cache_project_list_once(self):
#     def clear_project_cache(self):
#     def _get_project_for_name(self, project_name):
#     def _get_file_path_dict_for_project(project):
#     def delete_file(self, project_name, remote_path):
#     def can_deliver_to_user_with_email(self, email_address, logging_func):
#     def can_deliver_to_user_with_username(self, username, logging_func):
#     def move_file_or_folder(self, project_name, source_remote_path, target_remote_path):
#     def is_project_consistent(self, project_name):
#     def wait_for_project_consistency(self, project_name, wait_sec=5):


# Path: ddsc/sdk/tests/test_dukeds.py
from unittest import TestCase
from ddsc import DukeDS, ItemNotFound, DuplicateNameError, Session
from mock import patch, Mock, ANY

        dds_user_util = mock_user_util.return_value
        dds_user_util.user_or_affiliate_exists_for_email.assert_called_with("fakeuser@duke.edu")
        self.assertEqual(result, dds_user_util.user_or_affiliate_exists_for_email.return_value)

    @patch('ddsc.sdk.dukeds.Client')
    @patch('ddsc.sdk.dukeds.UserUtil')
    def test_can_deliver_to_user_with_email_with_logging_func(self, mock_user_util, mock_client):
        mock_log_func = Mock()
        result = DukeDS.can_deliver_to_user_with_email(email_address='fakeuser@duke.edu', logging_func=mock_log_func)
        mock_user_util.assert_called_with(mock_client.return_value.dds_connection.data_service,
                                          logging_func=mock_log_func)
        dds_user_util = mock_user_util.return_value
        dds_user_util.user_or_affiliate_exists_for_email.assert_called_with("fakeuser@duke.edu")
        self.assertEqual(result, dds_user_util.user_or_affiliate_exists_for_email.return_value)

    @patch('ddsc.sdk.dukeds.Client')
    @patch('ddsc.sdk.dukeds.UserUtil')
    def test_can_deliver_to_user_with_username(self, mock_user_util, mock_client):
        result = DukeDS.can_deliver_to_user_with_username(username='fakeuser')
        mock_user_util.assert_called_with(mock_client.return_value.dds_connection.data_service, logging_func=ANY)
        dds_user_util = mock_user_util.return_value
        dds_user_util.user_or_affiliate_exists_for_username.assert_called_with("fakeuser")
        self.assertEqual(result, dds_user_util.user_or_affiliate_exists_for_username.return_value)

    @patch('ddsc.sdk.dukeds.Client')
    @patch('ddsc.sdk.dukeds.UserUtil')
    def test_can_deliver_to_user_with_username_with_logging_func(self, mock_user_util, mock_client):
        mock_log_func = Mock()
        result = DukeDS.can_deliver_to_user_with_username(username='fakeuser', logging_func=mock_log_func)
        mock_user_util.assert_called_with(mock_client.return_value.dds_connection.data_service,

                                          logging_func=mock_log_func)