# 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, exceptions
        from cum.scrapers import madokami
import cumtest
import os
import unittest
        self.assertIs(series.directory, None)
        self.assertEqual(len(series.chapters), len(data['chapters']))
        for chapter in series.chapters:
            self.assertEqual(chapter.name, data['name'])
            self.assertEqual(chapter.alias, data['alias'])
            self.assertIn(chapter.chapter, data['chapters'])
            data['chapters'].remove(chapter.chapter)
            for group in chapter.groups:
                self.assertIn(group, data['groups'])
            self.assertIs(chapter.directory, None)
        self.assertEqual(len(data['chapters']), 0)

    @cumtest.skipIfNoMadokamiLogin
    def test_chapter_filename_no_group(self):
        URL = ('https://manga.madokami.al/Manga/_/__/__DA/7-Daime%20no%20'
               'Tomari%21/7-Daime%20no%20Tomari%21%20v01%20c01.zip')
        chapter = madokami.MadokamiChapter.from_url(URL)
        self.assertEqual(chapter.chapter, '01')
        self.assertEqual(len(chapter.groups), 0)
        path = os.path.join(
            self.directory.name, '7-Daime no Tomari',
            '7-Daime no Tomari - c001 [Unknown].zip'
        )
        self.assertEqual(chapter.filename, path)

    def test_chapter_invalid_login(self):
        URL = ('https://manga.madokami.al/Manga/Oneshots/100%20Dollar%20wa%20'
               'Yasu%20Sugiru/100%24%20is%20Too%20Cheap%20%5BYAMAMOTO%20Kazune'
               '%5D%20-%20000%20%5BOneshot%5D%20%5BPeebs%5D.zip')
        config.get().madokami.password = '12345'

# 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_scraper_madokami.py
from cum import config, exceptions
        from cum.scrapers import madokami
import cumtest
import os
import unittest

        self.assertIs(series.directory, None)
        self.assertEqual(len(series.chapters), len(data['chapters']))
        for chapter in series.chapters:
            self.assertEqual(chapter.name, data['name'])
            self.assertEqual(chapter.alias, data['alias'])
            self.assertIn(chapter.chapter, data['chapters'])
            data['chapters'].remove(chapter.chapter)
            for group in chapter.groups:
                self.assertIn(group, data['groups'])
            self.assertIs(chapter.directory, None)
        self.assertEqual(len(data['chapters']), 0)

    @cumtest.skipIfNoMadokamiLogin
    def test_chapter_filename_no_group(self):
        URL = ('https://manga.madokami.al/Manga/_/__/__DA/7-Daime%20no%20'
               'Tomari%21/7-Daime%20no%20Tomari%21%20v01%20c01.zip')
        chapter = madokami.MadokamiChapter.from_url(URL)
        self.assertEqual(chapter.chapter, '01')
        self.assertEqual(len(chapter.groups), 0)
        path = os.path.join(
            self.directory.name, '7-Daime no Tomari',
            '7-Daime no Tomari - c001 [Unknown].zip'
        )
        self.assertEqual(chapter.filename, path)

    def test_chapter_invalid_login(self):
        URL = ('https://manga.madokami.al/Manga/Oneshots/100%20Dollar%20wa%20'
               'Yasu%20Sugiru/100%24%20is%20Too%20Cheap%20%5BYAMAMOTO%20Kazune'
               '%5D%20-%20000%20%5BOneshot%5D%20%5BPeebs%5D.zip')
        config.get().madokami.password = '12345'

        config.get().madokami.username = 'Koala'