# Path: onedrived/od_context.py
# def is_invalid_username(s):
# def get_login_username():
# def load_context(loop=None):
# def save_context(ctx):
#     def __init__(self, loop):
#     def _create_config_dir_if_missing(self):
#     def _copy_default_config_file(self, resource_filename, target_filename):
#     def loop(self):
#     def loop(self, v):
#     def watcher(self):
#     def watcher(self, watcher):
#     def set_logger(min_level=logging.WARNING, path=None):
#     def _add_and_return(self, config_key, id_key, obj, data):
#     def add_account(self, account_profile):
#     def get_account(self, account_id):
#     def delete_account(self, account_id):
#     def all_accounts(self):
#     def add_drive(self, drive_config):
#     def get_drive(self, drive_id):
#     def delete_drive(self, drive_id):
#     def all_drives(self):
#     def load_config(self, filename):
#     def save_config(self, filename):
# class UserContext:
#     DEFAULT_CONFIG = {
#         'accounts': {},
#         'drives': {},
#         'scan_interval_sec': 21600,  # Poll every 6 hours.
#         'webhook_type': od_webhooks.DEFAULT_WEBHOOK_TYPE,
#         'webhook_host': '',
#         'webhook_port': 0,
#         'webhook_renew_interval_sec': 7200,  # Renew webhook every 2 hours.
#         'webhook_action_delay_sec': 120,
#         'num_workers': 2,
#         'start_delay_sec': 0,
#         'logfile_path': ''
#     }
#     DEFAULT_CONFIG_FILENAME = 'onedrived_config_v2.json'
#     DEFAULT_IGNORE_FILENAME = 'ignore_v2.txt'
#     DEFAULT_NGROK_CONF_FILENAME = 'ngrok_conf.yaml'


import asyncio
import unittest
from onedrived import od_context



def get_sample_context():
    return od_context.UserContext(loop=asyncio.get_event_loop())


class TestUserContext(unittest.TestCase):

    def setUp(self):
        self.ctx = get_sample_context()

    def test_get_login_username(self):

# Path: onedrived/od_context.py
# def is_invalid_username(s):
# def get_login_username():
# def load_context(loop=None):
# def save_context(ctx):
#     def __init__(self, loop):
#     def _create_config_dir_if_missing(self):
#     def _copy_default_config_file(self, resource_filename, target_filename):
#     def loop(self):
#     def loop(self, v):
#     def watcher(self):
#     def watcher(self, watcher):
#     def set_logger(min_level=logging.WARNING, path=None):
#     def _add_and_return(self, config_key, id_key, obj, data):
#     def add_account(self, account_profile):
#     def get_account(self, account_id):
#     def delete_account(self, account_id):
#     def all_accounts(self):
#     def add_drive(self, drive_config):
#     def get_drive(self, drive_id):
#     def delete_drive(self, drive_id):
#     def all_drives(self):
#     def load_config(self, filename):
#     def save_config(self, filename):
# class UserContext:
#     DEFAULT_CONFIG = {
#         'accounts': {},
#         'drives': {},
#         'scan_interval_sec': 21600,  # Poll every 6 hours.
#         'webhook_type': od_webhooks.DEFAULT_WEBHOOK_TYPE,
#         'webhook_host': '',
#         'webhook_port': 0,
#         'webhook_renew_interval_sec': 7200,  # Renew webhook every 2 hours.
#         'webhook_action_delay_sec': 120,
#         'num_workers': 2,
#         'start_delay_sec': 0,
#         'logfile_path': ''
#     }
#     DEFAULT_CONFIG_FILENAME = 'onedrived_config_v2.json'
#     DEFAULT_IGNORE_FILENAME = 'ignore_v2.txt'
#     DEFAULT_NGROK_CONF_FILENAME = 'ngrok_conf.yaml'


# Path: tests/test_context.py
import asyncio
import unittest
from onedrived import od_context




def get_sample_context():
    return od_context.UserContext(loop=asyncio.get_event_loop())


class TestUserContext(unittest.TestCase):

    def setUp(self):
        self.ctx = get_sample_context()

    def test_get_login_username(self):

        self.assertIsInstance(od_context.get_login_username(), str)