Revert "Revert "change to pytest""

This reverts commit f3e3ab8d8b.
master
Hans P. Möller 4 years ago
parent f3e3ab8d8b
commit 1e710e26c2

2
debian/changelog vendored

@ -1,4 +1,4 @@
lubuntu-breeze-color (0.1) UNRELEASED; urgency=medium lubuntu-breeze-config (0.1dev) UNRELEASED; urgency=medium
* Initial release. (Closes: #XXXXXX) * Initial release. (Closes: #XXXXXX)

15
debian/control vendored

@ -1,4 +1,4 @@
Source: lubuntu-breeze-color Source: lubuntu-breeze-config
Section: utils Section: utils
Priority: optional Priority: optional
Maintainer: Hans P Möller <hmollercl@lubuntu.me> Maintainer: Hans P Möller <hmollercl@lubuntu.me>
@ -9,12 +9,15 @@ Build-Depends: debhelper-compat (= 12),
xvfb xvfb
Standards-Version: 4.5.0 Standards-Version: 4.5.0
Rules-Requires-Root: no Rules-Requires-Root: no
Testsuite: autopkgtest-pkg-python
Package: lubuntu-breeze-color Package: lubuntu-breeze-config
Architecture: all Architecture: all
Depends: python3, python3-pyqt5, ${misc:Depends}, ${python3:Depends} Depends: python3, python3-pyqt5, ${misc:Depends}, ${python3:Depends}
Description: Breeze Theme Color Scheme Selector Description: Breeze Theme Color Scheme Selector
It lets you pick a color scheme from "/usr/share/color-schemes/" and copy it It lets you pick a color scheme and change the transparency of the menus.
to "~/.config/kdeglobals" so system use it. Applications need restart in order Color schemes are obtained from "/usr/share/color-schemes/" and when selected
to use it. Take into consideration that some file managers also manage the copy to "~/.config/kdeglobals". For transparency of menu the settings are in
desktop so you need to restart that too. "~/.config/breezerc", a composition software is needed to take effect.
Applications need restart in order to apply changes. Take into consideration
that some file managers also manage the desktop so you need to restart that too.

@ -1,2 +0,0 @@
data/breeze-color.desktop /usr/share/applications/breeze-color.desktop
data/designer /usr/share/lubuntu-breeze-color/designer

@ -0,0 +1,2 @@
# data/breeze-color.desktop /usr/share/applications/breeze-color.desktop
# data/designer /usr/share/lubuntu-breeze-color/designer

4
debian/rules vendored

@ -1,10 +1,10 @@
#! /usr/bin/make -f #! /usr/bin/make -f
export DH_VERBOSE=1 export DH_VERBOSE=1
export PYBUILD_INTERPRETERS=python3 export PYBUILD_INTERPRETERS=python3
export PYBUILD_NAME=lubuntu-breeze-color export PYBUILD_NAME=lubuntu-breeze-config
%: %:
dh $@ --with python3 --buildsystem=pybuild dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_test: override_dh_auto_test:
xvfb-run dh_auto_test xvfb-run dh_auto_test -- --test-pytest

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
xvfb-run # xvfb-run python3 setup.py test
python3 setup.py test xvfb-run python3 test/test_gui.py

@ -35,7 +35,8 @@ class MainWindow(QWidget):
self.datadir = options.datadir self.datadir = options.datadir
self.bindir = options.bindir self.bindir = options.bindir
else: else:
self.datadir = '/usr/share/lubuntu-breeze-config/designer' self.datadir = '/usr/share/lubuntu-breeze-config'
self.bindir = '/bin'
uic.loadUi("%s/designer/main.ui" % self.datadir, self) uic.loadUi("%s/designer/main.ui" % self.datadir, self)
self.confFile = Path(Path.home() / ".config/kdeglobals") self.confFile = Path(Path.home() / ".config/kdeglobals")
self.schemeDir = "/usr/share/color-schemes/" self.schemeDir = "/usr/share/color-schemes/"

@ -20,11 +20,10 @@ from setuptools import setup
setup( setup(
name="lubuntu-breeze-config", name="lubuntu-breeze-config",
version="0.1dev", version="0.1.dev0",
packages=['lubuntu-breeze-config'], packages=['lubuntubreeze'],
scripts=['breeze-config'], scripts=['breeze-config'],
data_files=[('libexec/lubuntu-breeze-config/', ['lubuntuBreeze.py']), data_files=[('share/applications/', ['data/breeze-config.desktop']),
('share/applications/', ['data/breeze-config.desktop']),
('share/lubuntu-breeze-config/designer/', ('share/lubuntu-breeze-config/designer/',
['data/designer/main.ui'])], ['data/designer/main.ui'])],
test_suite="tests", test_suite="tests",

@ -3,45 +3,36 @@
import unittest import unittest
import sys import sys
import os
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QDir, QSettings from PyQt5.QtCore import QDir, QSettings
# from PyQt5.QtTest import QTest # from PyQt5.QtTest import QTest
from pathlib import Path from pathlib import Path
from gettext import gettext as _ # better than in main "_ = gettext.gettext" for testing from gettext import gettext as _ # better than in main "_ = gettext.gettext" for testing
# from lubuntuBreezeConfig import lubuntuBreeze
# import lubuntuBreezeConfig # import lubuntuBreezeConfig
# help(lubuntuBreezeConfig) # help(lubuntuBreezeConfig)
sys.path.insert(0, "") # sys.path.insert(0, "../")
import lubuntuBreeze sys.path.insert(0, "../")
from lubuntubreeze import breezeconfig
app = QApplication(sys.argv)
class ParserHelper():
def __init__(self):
self.datadir = '../../../data'
self.bindir = '.'
app = QApplication(sys.argv)
class LubuntuBreezeTest(unittest.TestCase): class LubuntuBreezeTest(unittest.TestCase):
def setUp(self): def setUp(self):
self.form = lubuntuBreeze.MainWindow() options = ParserHelper()
self.form = breezeconfig.MainWindow(options)
dir = QDir(self.form.schemeDir) dir = QDir(self.form.schemeDir)
self.files = dir.entryList(dir, dir.Files) self.files = dir.entryList(dir, dir.Files)
self.confFile = Path(Path.home() / ".config/kdeglobals") self.confFile = Path(Path.home() / ".config/kdeglobals")
def testText(self):
'''Test GUI in default state'''
label = _("Select Color Scheme for Breeze Qt Style:")
noteText =_("Applications need to be restarted for changes to take effect.")
noteText += "<br/>"
noteText += _("In case of pcmanfm-qt, since it handles the desktop, ")
noteText += _("a restart of the desktop is needed") + "<br/>"
noteText += _("Easier, restart session.")
noteText += "<br/>"
noteText += _("Best results if a matching GTK Theme is selected.")
self.assertEqual(self.form.label.text(), label)
self.assertEqual(self.form.note.text(), '<font size="-1">' + noteText + '</font>')
def testComoboxPopulation(self): def testComoboxPopulation(self):
'''test if combobox is populated with same entries as number of files '''test if combobox is populated with same entries as number of files
(+1 because on None)''' (+1 because on None)'''

@ -0,0 +1,10 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py27,py36
[testenv]
# install pytest in the virtualenv where commands will be executed
deps = pytest
commands =
# NOTE: you can run any command line tool here - not just tests
pytest
Loading…
Cancel
Save