def test_setUpBasicSettingFiles(tmpdir):
    SettingManager.SETTING_DIRECTORY = tmpdir
    SettingManager.MAIN_SETTING_FILE = tmpdir + "\\MainSetting"
    SettingManager.NOTIFICATION_SETTING_FILE = tmpdir + "\\NotificationSetting"
    SettingManager.CHAT_CSS_FILE = tmpdir + "\\ChatCSS"
    SettingManager.setUpBasicSettingFiles()
    assert SettingManager.CHAT_CSS_FILE.read(
    ) == "QTextBrowser { background-color: black; color: white; }", "set up basic setting files failed: chat css file"
    assert SettingManager.NOTIFICATION_SETTING_FILE.read(
    ) == "Consolas\n10\n#ffff7f\n#000000\n\n", "set up basic setting files failed: notification setting file"
    assert SettingManager.MAIN_SETTING_FILE.read(
    ) == "Consolas\n10\n10\n\n", "set up basic setting files failed: main setting file"
Ejemplo n.º 2
0
 def __init__(self):
     if not os.path.exists(CacheManager.DIRECTORY):
         os.mkdir(CacheManager.DIRECTORY)
     if not SettingManager.checkBasicSettingFilesCompletion():
         SettingManager.setUpBasicSettingFiles()
     super().__init__()
     self.setAttribute(Qt.WA_DeleteOnClose)
     self.setWindowTitle('Twitch chat')
     self.left = 500
     self.top = 40
     self.width = 500
     self.height = 900
     self.setGeometry(self.left, self.top, self.width, self.height)
     self.centralWidget = CentralWidget(self)
     self.setCentralWidget(self.centralWidget)
     menu = MenuBar(self)
     self.setMenuBar(menu)
     self.show()