# Path: redcap/project.py
# class Project(
#     methods.field_names.FieldNames,
#     methods.files.Files,
#     methods.instruments.Instruments,
#     methods.metadata.Metadata,
#     methods.project_info.ProjectInfo,
#     methods.records.Records,
#     methods.reports.Reports,
#     methods.surveys.Surveys,
#     methods.users.Users,
#     methods.version.Version,
# ):
#     """Main class for interacting with REDCap projects
# 
#     Attributes:
#         verify_ssl: Verify SSL, default True. Can pass path to CA_BUNDLE
# 
#     Note:
#         Your REDCap token should be kept **secret**! Treat it like a password
#         and NEVER save it directly in your script/application. Rather it should be obscured
#         and retrieved 'behind the scenes'. For example, saving the token as an environment
#         variable and retrieving it with `os.getenv`. The creation of the `TOKEN` string in
#         the example is not shown, for the above reasons
# 
#     Examples:
#         >>> from redcap import Project
#         >>> URL = "https://redcapdemo.vanderbilt.edu/api/"
#         >>> proj = Project(URL, TOKEN)
#         >>> proj.field_names
#         ['record_id', 'field_1', 'checkbox_field', 'upload_field']
#         >>> proj.is_longitudinal
#         True
#         >>> proj.def_field
#         'record_id'
# 
#         The url and token attributes are read-only, to prevent users from accidentally
#         overwriting them
#         >>> proj.url = "whoops"
#         Traceback (most recent call last):
#         ...
#         AttributeError: can't set attribute
#     """
# 
#     @property
#     def redcap_version(self) -> Optional[semantic_version.Version]:
#         """REDCap version of the Project"""
#         self._redcap_version: Optional[semantic_version.Version]
#         try:
#             return self._redcap_version
#         except AttributeError:
#             self._redcap_version = self.export_version()
#             return self._redcap_version


from datetime import datetime
from pathlib import Path
from redcap import Project
import os
import pytest
import requests
    return "https://redcapdemo.vanderbilt.edu/api/"


@pytest.fixture(scope="module")
def simple_project_token(redcapdemo_url) -> str:
    """Create a simple project and return it's API token"""
    simple_project_xml_path = Path("tests/data/test_simple_project.xml")
    project_token = create_project(redcapdemo_url, SUPER_TOKEN, simple_project_xml_path)

    return project_token


@pytest.fixture(scope="module")
def simple_project(redcapdemo_url, simple_project_token):
    """A simple REDCap project"""
    return Project(redcapdemo_url, simple_project_token)


@pytest.fixture(scope="module")
def long_project_token(redcapdemo_url) -> str:
    """Create a long project and return it's API token"""
    long_project_xml_path = Path("tests/data/test_long_project.xml")
    project_token = create_project(redcapdemo_url, SUPER_TOKEN, long_project_xml_path)

    return project_token


@pytest.fixture(scope="module")
def long_project(redcapdemo_url, long_project_token):
    """A long REDCap project"""

# Path: redcap/project.py
# class Project(
#     methods.field_names.FieldNames,
#     methods.files.Files,
#     methods.instruments.Instruments,
#     methods.metadata.Metadata,
#     methods.project_info.ProjectInfo,
#     methods.records.Records,
#     methods.reports.Reports,
#     methods.surveys.Surveys,
#     methods.users.Users,
#     methods.version.Version,
# ):
#     """Main class for interacting with REDCap projects
# 
#     Attributes:
#         verify_ssl: Verify SSL, default True. Can pass path to CA_BUNDLE
# 
#     Note:
#         Your REDCap token should be kept **secret**! Treat it like a password
#         and NEVER save it directly in your script/application. Rather it should be obscured
#         and retrieved 'behind the scenes'. For example, saving the token as an environment
#         variable and retrieving it with `os.getenv`. The creation of the `TOKEN` string in
#         the example is not shown, for the above reasons
# 
#     Examples:
#         >>> from redcap import Project
#         >>> URL = "https://redcapdemo.vanderbilt.edu/api/"
#         >>> proj = Project(URL, TOKEN)
#         >>> proj.field_names
#         ['record_id', 'field_1', 'checkbox_field', 'upload_field']
#         >>> proj.is_longitudinal
#         True
#         >>> proj.def_field
#         'record_id'
# 
#         The url and token attributes are read-only, to prevent users from accidentally
#         overwriting them
#         >>> proj.url = "whoops"
#         Traceback (most recent call last):
#         ...
#         AttributeError: can't set attribute
#     """
# 
#     @property
#     def redcap_version(self) -> Optional[semantic_version.Version]:
#         """REDCap version of the Project"""
#         self._redcap_version: Optional[semantic_version.Version]
#         try:
#             return self._redcap_version
#         except AttributeError:
#             self._redcap_version = self.export_version()
#             return self._redcap_version


# Path: tests/integration/conftest.py
from datetime import datetime
from pathlib import Path
from redcap import Project
import os
import pytest
import requests

    return "https://redcapdemo.vanderbilt.edu/api/"


@pytest.fixture(scope="module")
def simple_project_token(redcapdemo_url) -> str:
    """Create a simple project and return it's API token"""
    simple_project_xml_path = Path("tests/data/test_simple_project.xml")
    project_token = create_project(redcapdemo_url, SUPER_TOKEN, simple_project_xml_path)

    return project_token


@pytest.fixture(scope="module")
def simple_project(redcapdemo_url, simple_project_token):
    """A simple REDCap project"""
    return Project(redcapdemo_url, simple_project_token)


@pytest.fixture(scope="module")
def long_project_token(redcapdemo_url) -> str:
    """Create a long project and return it's API token"""
    long_project_xml_path = Path("tests/data/test_long_project.xml")
    project_token = create_project(redcapdemo_url, SUPER_TOKEN, long_project_xml_path)

    return project_token


@pytest.fixture(scope="module")
def long_project(redcapdemo_url, long_project_token):
    """A long REDCap project"""

    return Project(redcapdemo_url, long_project_token)