# This is small script to see if Domna Sharepoint Client works
# for basic functionality

# Can we import it?
from io import BytesIO

from utils.sharepoint.domna_sharepoint_client import DomnaSharepointClient, DomnaSites


# can we initliase it
client = DomnaSharepointClient(sharepoint_location=DomnaSites.SOCIAL_HOUSING_WAVE_3)

# can we get an example of root path?

client.get_folders_in_path("/")
client.get_folders_in_path("/JTK Test Folder")

# can we make a folder appear in JTK Test Folder?
client.makedir("Dan is the best", "/JTK Test Folder")

content = BytesIO(b"Hello, this is some file content!")
path = client.create_temp_file(content, "some/place/over/the/rainbow")
client.upload_file(
    path, "/JTK Test Folder/Dan is the best", "junte_is_the_worst_at_python.txt"
)
