# Path: cum/config.py
# class BaseConfig(object):
# class MadokamiConfig(object):
#     def __init__(self):
#     def __setattr__(self, name, value):
#     def default_download_directory(self):
#     def load(self):
#     def serialize(self):
#     def write(self):
#     def __init__(self, config, dict):
#     def login(self):
# def get():
# def initialize(directory=None):
# 
# Path: cum/exceptions.py
# class CumException(Exception):
# class LoginError(CumException):
# class ScrapingError(CumException):
# class ConfigError(CumException):
#     def __init__(self, message=''):
#     def __str__(self):
#     def __init__(self, config, cursor, message=''):


from cum import config
from cum import exceptions
import cumtest
    def test_config_set_cbz_false(self):
        config.get().cbz = True
        config.get().write()

        result = self.invoke('config', 'set', 'cbz', 'False')
        self.assertEqual(result.exit_code, 0)
        self.assertFalse(config.get().cbz)

    def test_config_set_invalid_setting(self):
        MESSAGE = 'Setting not found'

        result = self.invoke('config', 'set', 'cuterobots.sex', 'female')
        self.assertEqual(result.exit_code, 1)
        self.assertIn(MESSAGE, result.output)

    def test_config_set_invalid_subsetting(self):
        MESSAGE = 'Setting not found'

        result = self.invoke('config', 'set', 'batoto.trashing', 'True')
        self.assertEqual(result.exit_code, 1)
        self.assertIn(MESSAGE, result.output)

    def test_config_set_no_setting(self):
        MESSAGE = 'You must specify a setting'

        result = self.invoke('config', 'set')
        self.assertEqual(result.exit_code, 1)
        self.assertIn(MESSAGE, result.output)

    def test_config_set_no_value(self):

# Path: cum/config.py
# class BaseConfig(object):
# class MadokamiConfig(object):
#     def __init__(self):
#     def __setattr__(self, name, value):
#     def default_download_directory(self):
#     def load(self):
#     def serialize(self):
#     def write(self):
#     def __init__(self, config, dict):
#     def login(self):
# def get():
# def initialize(directory=None):
# 
# Path: cum/exceptions.py
# class CumException(Exception):
# class LoginError(CumException):
# class ScrapingError(CumException):
# class ConfigError(CumException):
#     def __init__(self, message=''):
#     def __str__(self):
#     def __init__(self, config, cursor, message=''):


# Path: tests/test_cli_config.py
from cum import config
from cum import exceptions
import cumtest

    def test_config_set_cbz_false(self):
        config.get().cbz = True
        config.get().write()

        result = self.invoke('config', 'set', 'cbz', 'False')
        self.assertEqual(result.exit_code, 0)
        self.assertFalse(config.get().cbz)

    def test_config_set_invalid_setting(self):
        MESSAGE = 'Setting not found'

        result = self.invoke('config', 'set', 'cuterobots.sex', 'female')
        self.assertEqual(result.exit_code, 1)
        self.assertIn(MESSAGE, result.output)

    def test_config_set_invalid_subsetting(self):
        MESSAGE = 'Setting not found'

        result = self.invoke('config', 'set', 'batoto.trashing', 'True')
        self.assertEqual(result.exit_code, 1)
        self.assertIn(MESSAGE, result.output)

    def test_config_set_no_setting(self):
        MESSAGE = 'You must specify a setting'

        result = self.invoke('config', 'set')
        self.assertEqual(result.exit_code, 1)
        self.assertIn(MESSAGE, result.output)

    def test_config_set_no_value(self):

        MESSAGE = 'You must specify a value'