# 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 bs4 import BeautifulSoup
from cum import config, exceptions
from urllib.parse import urljoin
        from cum.scrapers import mangadex
import cumtest
import os
import re
import requests
import tempfile
import unittest
import zipfile
                            'Ramen Daisuki Koizumi-san',
                            'Ramen Daisuki Koizumi-san - c018 [Saiko Scans].zip')
        self.assertEqual(chapter.filename, path)
        chapter.download()
        self.assertTrue(os.path.isfile(path))
        with zipfile.ZipFile(path) as chapter_zip:
            files = chapter_zip.infolist()
            self.assertEqual(len(files), 8)

    def test_chapter_information_hidamari_sketch(self):
        URL = 'https://mangadex.org/chapter/9833'
        chapter = mangadex.MangadexChapter.from_url(URL)
        self.assertEqual(chapter.alias, 'hidamari-sketch')
        self.assertEqual(chapter.chapter, '0')
        self.assertEqual(chapter.groups, ['Highlanders'])
        self.assertEqual(chapter.name, 'Hidamari Sketch')
        self.assertEqual(chapter.title, None)
        path = os.path.join(
            self.directory.name, 'Hidamari Sketch',
            'Hidamari Sketch - c000 [Highlanders].zip'
        )
        self.assertEqual(chapter.filename, path)
        chapter.download()
        self.assertTrue(os.path.isfile(path))
        with zipfile.ZipFile(path) as chapter_zip:
            files = chapter_zip.infolist()
            self.assertEqual(len(files), 11)

    def test_chapter_information_tomochan(self):
        URL = 'https://mangadex.org/chapter/28082'

# 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_mangadex.py
from bs4 import BeautifulSoup
from cum import config, exceptions
from urllib.parse import urljoin
        from cum.scrapers import mangadex
import cumtest
import os
import re
import requests
import tempfile
import unittest
import zipfile

                            'Ramen Daisuki Koizumi-san',
                            'Ramen Daisuki Koizumi-san - c018 [Saiko Scans].zip')
        self.assertEqual(chapter.filename, path)
        chapter.download()
        self.assertTrue(os.path.isfile(path))
        with zipfile.ZipFile(path) as chapter_zip:
            files = chapter_zip.infolist()
            self.assertEqual(len(files), 8)

    def test_chapter_information_hidamari_sketch(self):
        URL = 'https://mangadex.org/chapter/9833'
        chapter = mangadex.MangadexChapter.from_url(URL)
        self.assertEqual(chapter.alias, 'hidamari-sketch')
        self.assertEqual(chapter.chapter, '0')
        self.assertEqual(chapter.groups, ['Highlanders'])
        self.assertEqual(chapter.name, 'Hidamari Sketch')
        self.assertEqual(chapter.title, None)
        path = os.path.join(
            self.directory.name, 'Hidamari Sketch',
            'Hidamari Sketch - c000 [Highlanders].zip'
        )
        self.assertEqual(chapter.filename, path)
        chapter.download()
        self.assertTrue(os.path.isfile(path))
        with zipfile.ZipFile(path) as chapter_zip:
            files = chapter_zip.infolist()
            self.assertEqual(len(files), 11)

    def test_chapter_information_tomochan(self):
        URL = 'https://mangadex.org/chapter/28082'

        config.get().cbz = True