# 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):


from cum import config
from unittest import mock
import cumtest
import os
        series.follow()

        result = self.invoke('follow', FOLLOW['url'])
        self.assertEqual(result.exit_code, 0)
        for message in MESSAGES:
            self.assertIn(message, result.output)

    def test_follow_invalid(self):
        URL = 'http://www.google.com'
        MESSAGE = 'Invalid URL "{}"'.format(URL)

        result = self.invoke('follow', URL)
        self.assertEqual(result.exit_code, 0)
        self.assertIn(MESSAGE, result.output)

    @cumtest.skipIfNoMadokamiLogin
    def test_follow_madokami(self):
        URL = 'https://manga.madokami.al/Manga/A/AK/AKUM/Akuma%20no%20Riddle'
        MESSAGE = 'Adding follow for Akuma no Riddle (akuma-no-riddle)'

        result = self.invoke('follow', URL)
        self.assertEqual(result.exit_code, 0)
        self.assertIn(MESSAGE, result.output)

    def test_follow_madokami_download_invalid_login(self):
        URL = 'https://manga.madokami.al/Manga/A/AK/AKUM/Akuma%20no%20Riddle'
        MESSAGE = '==> Madokami login error (' + URL + ')'

        config.get().madokami.password = 'notworking'
        config.get().madokami.username = 'notworking'

# 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: tests/test_cli_follow.py
from cum import config
from unittest import mock
import cumtest
import os

        series.follow()

        result = self.invoke('follow', FOLLOW['url'])
        self.assertEqual(result.exit_code, 0)
        for message in MESSAGES:
            self.assertIn(message, result.output)

    def test_follow_invalid(self):
        URL = 'http://www.google.com'
        MESSAGE = 'Invalid URL "{}"'.format(URL)

        result = self.invoke('follow', URL)
        self.assertEqual(result.exit_code, 0)
        self.assertIn(MESSAGE, result.output)

    @cumtest.skipIfNoMadokamiLogin
    def test_follow_madokami(self):
        URL = 'https://manga.madokami.al/Manga/A/AK/AKUM/Akuma%20no%20Riddle'
        MESSAGE = 'Adding follow for Akuma no Riddle (akuma-no-riddle)'

        result = self.invoke('follow', URL)
        self.assertEqual(result.exit_code, 0)
        self.assertIn(MESSAGE, result.output)

    def test_follow_madokami_download_invalid_login(self):
        URL = 'https://manga.madokami.al/Manga/A/AK/AKUM/Akuma%20no%20Riddle'
        MESSAGE = '==> Madokami login error (' + URL + ')'

        config.get().madokami.password = 'notworking'
        config.get().madokami.username = 'notworking'

        config.get().write()