4
0
mirror of https://github.com/RicterZ/nhentai.git synced 2025-05-04 18:36:24 +02:00
nhentai/tests/test_login.py
2023-02-06 17:49:42 +08:00

30 lines
754 B
Python

import os
import unittest
import urllib3.exceptions
from nhentai import constant
from nhentai.cmdline import load_config
from nhentai.utils import check_cookie
class TestLogin(unittest.TestCase):
def setUp(self) -> None:
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
load_config()
constant.CONFIG['cookie'] = os.getenv('NHENTAI_COOKIE')
constant.CONFIG['useragent'] = os.getenv('NHENTAI_UA')
def test_cookie_set(self):
raise Exception(constant.CONFIG['useragent'])
def test_cookie(self):
try:
check_cookie()
self.assertTrue(True)
except Exception as e:
self.assertIsNone(e)
if __name__ == '__main__':
unittest.main()