# 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
        mock_project.name = 'myproject'
        mock_client.return_value.get_projects.return_value = [
            mock_project
        ]
        DukeDS.move_file_or_folder('myproject', '/data/file1.txt', '/data/file1_bak.txt')
        mock_project.move_file_or_folder.assert_called_with('/data/file1.txt', '/data/file1_bak.txt')

    @patch('ddsc.sdk.dukeds.Client')
    def test_create_folder(self, mock_client):
        mock_project = Mock()
        mock_project.try_get_item_for_path.return_value = None
        mock_project.create_folder.return_value.try_get_item_for_path.return_value = None
        mock_project.name = 'myproject'
        mock_client.return_value.get_projects.return_value = [
            mock_project
        ]
        DukeDS.create_folder('myproject', '/data/raw')
        mock_project.create_folder.assert_called_with("data")
        mock_project.create_folder.return_value.create_folder.assert_called_with("raw")


class TestSession(TestCase):
    @patch('ddsc.sdk.dukeds.Client', autospec=True)
    def test_constructor_default_args(self, mock_client):
        Session()
        mock_client.assert_called_with(None)

    @patch('ddsc.sdk.dukeds.Client', autospec=True)
    def test_constructor_passing_config(self, mock_client):
        mock_config = Mock()

# 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

        mock_project.name = 'myproject'
        mock_client.return_value.get_projects.return_value = [
            mock_project
        ]
        DukeDS.move_file_or_folder('myproject', '/data/file1.txt', '/data/file1_bak.txt')
        mock_project.move_file_or_folder.assert_called_with('/data/file1.txt', '/data/file1_bak.txt')

    @patch('ddsc.sdk.dukeds.Client')
    def test_create_folder(self, mock_client):
        mock_project = Mock()
        mock_project.try_get_item_for_path.return_value = None
        mock_project.create_folder.return_value.try_get_item_for_path.return_value = None
        mock_project.name = 'myproject'
        mock_client.return_value.get_projects.return_value = [
            mock_project
        ]
        DukeDS.create_folder('myproject', '/data/raw')
        mock_project.create_folder.assert_called_with("data")
        mock_project.create_folder.return_value.create_folder.assert_called_with("raw")


class TestSession(TestCase):
    @patch('ddsc.sdk.dukeds.Client', autospec=True)
    def test_constructor_default_args(self, mock_client):
        Session()
        mock_client.assert_called_with(None)

    @patch('ddsc.sdk.dukeds.Client', autospec=True)
    def test_constructor_passing_config(self, mock_client):
        mock_config = Mock()

        Session(mock_config)