Esempio n. 1
0
def setup_test_config():
    name = "gallerydl"
    email = "*****@*****.**"

    config.clear()
    config.set(("cache", "file"), ":memory:")
    config.set(("downloader", "part"), False)
    config.set(("extractor", "timeout"), 60)
    config.set(("extractor", "username"), name)
    config.set(("extractor", "password"), name)
    config.set(("extractor", "nijie", "username"), email)
    config.set(("extractor", "seiga", "username"), email)
    config.set(("extractor", "danbooru", "username"), None)
    config.set(("extractor", "twitter" , "username"), None)
    config.set(("extractor", "mangoxo" , "password"), "VZ8DL3983u")

    config.set(("extractor", "deviantart", "client-id"), "7777")
    config.set(("extractor", "deviantart", "client-secret"),
               "ff14994c744d9208e5caeec7aab4a026")

    config.set(("extractor", "tumblr", "api-key"),
               "0cXoHfIqVzMQcc3HESZSNsVlulGxEXGDTTZCDrRrjaa0jmuTc6")
    config.set(("extractor", "tumblr", "api-secret"),
               "6wxAK2HwrXdedn7VIoZWxGqVhZ8JdYKDLjiQjL46MLqGuEtyVj")
    config.set(("extractor", "tumblr", "access-token"),
               "N613fPV6tOZQnyn0ERTuoEZn0mEqG8m2K8M3ClSJdEHZJuqFdG")
    config.set(("extractor", "tumblr", "access-token-secret"),
               "sgOA7ZTT4FBXdOGGVV331sSp0jHYp4yMDRslbhaQf7CaS71i4O")
Esempio n. 2
0
def setup_test_config():
    name = "gallerydl"
    email = "*****@*****.**"

    config.clear()
    config.set(("cache", "file"), ":memory:")
    config.set(("downloader", "part"), False)
    config.set(("downloader", "adjust-extensions"), False)
    config.set(("extractor", "timeout"), 60)
    config.set(("extractor", "username"), name)
    config.set(("extractor", "password"), name)
    config.set(("extractor", "nijie", "username"), email)
    config.set(("extractor", "seiga", "username"), email)

    config.set(("extractor", "danbooru", "username"), None)
    config.set(("extractor", "instagram", "username"), None)
    config.set(("extractor", "imgur", "username"), None)
    config.set(("extractor", "twitter", "username"), None)

    config.set(("extractor", "mangoxo", "username"), "LiQiang3")
    config.set(("extractor", "mangoxo", "password"), "5zbQF10_5u25259Ma")

    config.set(("extractor", "deviantart", "client-id"), "7777")
    config.set(("extractor", "deviantart", "client-secret"),
               "ff14994c744d9208e5caeec7aab4a026")

    config.set(("extractor", "tumblr", "api-key"),
               "0cXoHfIqVzMQcc3HESZSNsVlulGxEXGDTTZCDrRrjaa0jmuTc6")
    config.set(("extractor", "tumblr", "api-secret"),
               "6wxAK2HwrXdedn7VIoZWxGqVhZ8JdYKDLjiQjL46MLqGuEtyVj")
    config.set(("extractor", "tumblr", "access-token"),
               "N613fPV6tOZQnyn0ERTuoEZn0mEqG8m2K8M3ClSJdEHZJuqFdG")
    config.set(("extractor", "tumblr", "access-token-secret"),
               "sgOA7ZTT4FBXdOGGVV331sSp0jHYp4yMDRslbhaQf7CaS71i4O")
Esempio n. 3
0
    def test_load(self):
        with tempfile.TemporaryDirectory() as base:
            path1 = os.path.join(base, "cfg1")
            with open(path1, "w") as file:
                file.write('{"a": 1, "b": {"a": 2, "c": "text"}}')

            path2 = os.path.join(base, "cfg2")
            with open(path2, "w") as file:
                file.write('{"a": 7, "b": {"a": 8, "e": "foo"}}')

            config.clear()
            config.load((path1, ))
            self.assertEqual(config.get((), "a"), 1)
            self.assertEqual(config.get(("b", ), "a"), 2)
            self.assertEqual(config.get(("b", ), "c"), "text")

            config.load((path2, ))
            self.assertEqual(config.get((), "a"), 7)
            self.assertEqual(config.get(("b", ), "a"), 8)
            self.assertEqual(config.get(("b", ), "c"), "text")
            self.assertEqual(config.get(("b", ), "e"), "foo")

            config.clear()
            config.load((path1, path2))
            self.assertEqual(config.get((), "a"), 7)
            self.assertEqual(config.get(("b", ), "a"), 8)
            self.assertEqual(config.get(("b", ), "c"), "text")
            self.assertEqual(config.get(("b", ), "e"), "foo")
Esempio n. 4
0
def setup_test_config():
    name = "gallerydl"
    email = "*****@*****.**"
    email2 = "*****@*****.**"

    config.clear()
    config.set(("cache", ), "file", None)
    config.set(("downloader", ), "part", False)
    config.set(("downloader", ), "adjust-extensions", False)
    config.set(("extractor", ), "timeout", 60)
    config.set(("extractor", ), "username", name)
    config.set(("extractor", ), "password", name)

    config.set(("extractor", "nijie"), "username", email)
    config.set(("extractor", "seiga"), "username", email)
    config.set(("extractor", "pinterest"), "username", email2)
    config.set(("extractor", "pinterest"), "username", None)  # login broken

    config.set(("extractor", "newgrounds"), "username", "d1618111")
    config.set(("extractor", "newgrounds"), "password", "d1618111")

    config.set(("extractor", "mangoxo"), "username", "LiQiang3")
    config.set(("extractor", "mangoxo"), "password", "5zbQF10_5u25259Ma")

    for category in ("danbooru", "instagram", "twitter", "subscribestar",
                     "e621", "inkbunny", "tapas", "pillowfort", "mangadex"):
        config.set(("extractor", category), "username", None)

    config.set(("extractor", "kemonoparty"), "cookies", {
        "__ddg1": "0gBDGpJ3KZQmA4B9QH25",
        "__ddg2": "lmj5s1jnJOvhPXCX"
    })
    config.set(("extractor", "seisoparty"), "cookies", {
        "__ddg1": "Y8rBxSDHO5UCEtQvzyI9",
        "__ddg2": "lmj5s1jnJOvhPXCX"
    })

    config.set(("extractor", "mastodon.social"), "access-token",
               "Blf9gVqG7GytDTfVMiyYQjwVMQaNACgf3Ds3IxxVDUQ")

    config.set(("extractor", "deviantart"), "client-id", "7777")
    config.set(("extractor", "deviantart"), "client-secret",
               "ff14994c744d9208e5caeec7aab4a026")

    config.set(("extractor", "tumblr"), "api-key",
               "0cXoHfIqVzMQcc3HESZSNsVlulGxEXGDTTZCDrRrjaa0jmuTc6")
    config.set(("extractor", "tumblr"), "api-secret",
               "6wxAK2HwrXdedn7VIoZWxGqVhZ8JdYKDLjiQjL46MLqGuEtyVj")
    config.set(("extractor", "tumblr"), "access-token",
               "N613fPV6tOZQnyn0ERTuoEZn0mEqG8m2K8M3ClSJdEHZJuqFdG")
    config.set(("extractor", "tumblr"), "access-token-secret",
               "sgOA7ZTT4FBXdOGGVV331sSp0jHYp4yMDRslbhaQf7CaS71i4O")
Esempio n. 5
0
 def tearDown(self):
     config.clear()
Esempio n. 6
0
 def tearDown(self):
     config.clear()
     os.remove(self._configfile)
Esempio n. 7
0
 def tearDownClass(cls):
     cls.path.cleanup()
     config.clear()
Esempio n. 8
0
 def tearDownClass(cls):
     cls.dir.cleanup()
     config.clear()
Esempio n. 9
0
 def tearDown(self):
     config.clear()
Esempio n. 10
0
 def tearDown(self):
     config.clear()
     os.remove(self._configfile)
Esempio n. 11
0
 def tearDownClass(cls):
     cls.path.cleanup()
     config.clear()
Esempio n. 12
0
 def tearDownClass(cls):
     cls.dir.cleanup()
     config.clear()