From 79fe6bb26752cf3aaa1911deb92b4bd61aa0ca60 Mon Sep 17 00:00:00 2001 From: dannygb Date: Fri, 16 Nov 2018 18:46:09 +0000 Subject: [PATCH] Removes un-used test files Cleans up the .pro files to remove extraneous config --- KeePit.pro | 10 ---- KeePit/KeePit.pro | 34 ------------ KeePit/tests/autopilot/KeePass3/__init__.py | 41 -------------- .../autopilot/KeePass3/tests/__init__.py | 54 ------------------- .../autopilot/KeePass3/tests/test_main.py | 21 -------- KeePit/tests/autopilot/run | 11 ---- 6 files changed, 171 deletions(-) delete mode 100644 KeePit/tests/autopilot/KeePass3/__init__.py delete mode 100644 KeePit/tests/autopilot/KeePass3/tests/__init__.py delete mode 100644 KeePit/tests/autopilot/KeePass3/tests/test_main.py delete mode 100644 KeePit/tests/autopilot/run diff --git a/KeePit.pro b/KeePit.pro index 1c25783..c8c5c37 100644 --- a/KeePit.pro +++ b/KeePit.pro @@ -29,13 +29,3 @@ UBUNTU_TRANSLATION_SOURCES+= \ # specifies all translations files and makes sure they are # compiled and installed into the right place in the click package UBUNTU_PO_FILES+=$$files(po/*.po) - -#aptest.target = autopilot -#aptest.commands = bash $$PWD/KeePit/tests/autopilot/run -#aptest.depends = sub-KeePit - -#unittest.target = check -#unittest.commands = /usr/bin/qmltestrunner -input $$PWD/KeePit/tests/unit -#unittest.depends = sub-KeePit - -#QMAKE_EXTRA_TARGETS += aptest unittest diff --git a/KeePit/KeePit.pro b/KeePit/KeePit.pro index 6355092..7f253fb 100644 --- a/KeePit/KeePit.pro +++ b/KeePit/KeePit.pro @@ -150,21 +150,10 @@ SOURCES += main.cpp \ RESOURCES += KeePit.qrc -QML_FILES += $$files(qml/*.qml,true) \ - $$files(*.js,true) - CONF_FILES += KeePit.apparmor \ KeePit.png \ KeePit.contenthub -AP_TEST_FILES += tests/autopilot/run \ - $$files(tests/*.py,true) - -#show all the files in QtCreator -OTHER_FILES += $${CONF_FILES} \ - $${QML_FILES} \ - $${AP_TEST_FILES} - #specify where the config files are installed to config_files.path = /KeePit config_files.files += $${CONF_FILES} @@ -336,29 +325,6 @@ HEADERS += \ bytestream.h \ stdafx.h -DISTFILES += \ - qml/OpenDatabase.qml \ - qml/Entry.qml \ - qml/EntryModel.qml \ - qml/ListEntryItems.qml \ - qml/Selector.qml \ - qml/Importer.qml \ - cryptopp/cryptest.exe \ - cryptopp/strciphr.o \ - cryptopp/polynomi.o \ - cryptopp/eprecomp.o \ - cryptopp/eccrypto.o \ - cryptopp/algebra.o \ - cryptopp/adhoc.o \ - cryptopp/Makefile \ - KeePit.desktop \ - KeePit.png \ - KeePit.contenthub \ - KeePit.apparmor \ - qml/CreateDatabase.qml \ - qml/KeySelector.qml \ - qml/PasswordInput.qml - LIBS += -L$$OUT_PWD/../ziplib/ -lziplib INCLUDEPATH += $$PWD/../ziplib diff --git a/KeePit/tests/autopilot/KeePass3/__init__.py b/KeePit/tests/autopilot/KeePass3/__init__.py deleted file mode 100644 index 08d0cc5..0000000 --- a/KeePit/tests/autopilot/KeePass3/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -"""Application autopilot helpers.""" - -import logging -import ubuntuuitoolkit - -logger = logging.getLogger(__name__) - - -class AppException(ubuntuuitoolkit.ToolkitException): - - """Exception raised when there are problems with the Application.""" - - -class TouchApp(object): - - """Autopilot helper object for the application.""" - - def __init__(self, app_proxy, test_type): - self.app = app_proxy - self.test_type = test_type - self.main_view = self.app.select_single(MainView) - - @property - def pointing_device(self): - return self.app.pointing_device - - -class MainView(ubuntuuitoolkit.MainView): - - """A helper that makes it easy to interact with the mainview""" - - def __init__(self, *args): - super(MainView, self).__init__(*args) - self.visible.wait_for(True, 30) - - def get_button(self): - return self.select_single('Button', objectName="button") - - def get_label(self): - return self.select_single('Label', objectName="label") diff --git a/KeePit/tests/autopilot/KeePass3/tests/__init__.py b/KeePit/tests/autopilot/KeePass3/tests/__init__.py deleted file mode 100644 index ef3441c..0000000 --- a/KeePit/tests/autopilot/KeePass3/tests/__init__.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -"""Ubuntu Touch App Autopilot tests.""" - -import os -import logging - -import KeePass3 - -from autopilot.testcase import AutopilotTestCase -from autopilot import logging as autopilot_logging - -import ubuntuuitoolkit -from ubuntuuitoolkit import base - -logger = logging.getLogger(__name__) - - -class BaseTestCase(AutopilotTestCase): - - """A common test case class - - """ - - local_location = os.path.dirname(os.path.dirname(os.getcwd())) - local_location_qml = os.path.join(local_location, 'Main.qml') - click_package = '{0}.{1}'.format('KeePass3', 'username') - - def setUp(self): - super(BaseTestCase, self).setUp() - self.launcher, self.test_type = self.get_launcher_and_type() - self.app = KeePass3.TouchApp(self.launcher(), self.test_type) - - def get_launcher_and_type(self): - if os.path.exists(self.local_location_qml): - launcher = self.launch_test_local - test_type = 'local' - else: - launcher = self.launch_test_click - test_type = 'click' - return launcher, test_type - - @autopilot_logging.log_action(logger.info) - def launch_test_local(self): - return self.launch_test_application( - base.get_qmlscene_launch_command(), - self.local_location_qml, - app_type='qt', - emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase) - - @autopilot_logging.log_action(logger.info) - def launch_test_click(self): - return self.launch_click_package( - self.click_package, - emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase) diff --git a/KeePit/tests/autopilot/KeePass3/tests/test_main.py b/KeePit/tests/autopilot/KeePass3/tests/test_main.py deleted file mode 100644 index 30ed250..0000000 --- a/KeePit/tests/autopilot/KeePass3/tests/test_main.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- - -from autopilot.matchers import Eventually -from testtools.matchers import Equals -from KeePass3 import tests - - -class MainViewTestCase(tests.BaseTestCase): - """Tests for the mainview""" - - def setUp(self): - super(MainViewTestCase, self).setUp() - - def test_click_button(self): - # Find and click the button - button = self.app.main_view.get_button() - self.app.pointing_device.click_object(button) - - # Make an assertion about what should happen - label = self.app.main_view.get_label() - self.assertThat(label.text, Eventually(Equals('..world!'))) diff --git a/KeePit/tests/autopilot/run b/KeePit/tests/autopilot/run deleted file mode 100644 index e05b372..0000000 --- a/KeePit/tests/autopilot/run +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [[ -z `which autopilot3` ]]; then - echo "python3-autopilot is not installed. Skip" - exit -fi - -SCRIPTPATH=`dirname $0` -pushd ${SCRIPTPATH} -autopilot3 run KeePass3 -popd