[X2Go-Commits] [python-x2go] 07/07: Drop unit test framework. Never really used (though we should have). (Fixes: #1259).

git-admin at x2go.org git-admin at x2go.org
Tue Mar 6 20:34:48 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository python-x2go.

commit 76464265760fa170656e12cddf79419b8759aff1
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Mar 6 20:33:17 2018 +0100

    Drop unit test framework. Never really used (though we should have). (Fixes: #1259).
---
 debian/changelog            |   2 +
 test.py                     |  28 ---------
 x2go/tests/__init__.py      |  31 ----------
 x2go/tests/runalltests.py   |  46 ---------------
 x2go/tests/test_printing.py | 136 --------------------------------------------
 5 files changed, 2 insertions(+), 241 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 179e4c3..3719199 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ python-x2go (0.5.99.0-0x2go1) UNRELEASED; urgency=medium
   * New upstream version (0.5.99.0):
     - Support Python2 and Python3 alike.
     - Build API doc with Sphinx.
+    - Drop unit test framework. Never really used (though we should have).
+      (Fixes: #1259).
   * debian/: Adapt to building API docs with Sphinx.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Fri, 22 Sep 2017 14:15:05 +0200
diff --git a/test.py b/test.py
deleted file mode 100755
index 4b31ff2..0000000
--- a/test.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-# Copyright (C) 2010-2016 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-#
-# Python X2Go is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Python X2Go is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-"""
-Unit tests for Python X2Go.
-"""
-import os
-
-if __name__ == "__main__":
-    os.chdir(os.path.join('x2go', 'tests',))
-    os.system('./runalltests.py')
diff --git a/x2go/tests/__init__.py b/x2go/tests/__init__.py
deleted file mode 100644
index 50fa030..0000000
--- a/x2go/tests/__init__.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright (C) 2010-2016 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-#
-# Python X2Go is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Python X2Go is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-__package__ = 'x2go.tests'
-__name__    = 'x2go.tests'
-
-import os
-import sys
-base = os.path.join(os.path.split(os.path.split(os.getcwd())[0])[0])
-
-# prepend the X2Go path (useful for building new packages)
-sys.path = [ os.path.normpath(base), ] + sys.path
-
-from . import runalltests
-from . import test_printing
diff --git a/x2go/tests/runalltests.py b/x2go/tests/runalltests.py
deleted file mode 100755
index d495701..0000000
--- a/x2go/tests/runalltests.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright (C) 2010-2016 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-#
-# Python X2Go is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Python X2Go is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-"""\
-This file is a default test runner as found in ZOPE/Plone products. It works
-fine for any kind of Python unit testing---as we do here for Python X2Go.
-"""
-
-import os
-import sys
-
-base = os.path.join(os.path.split(os.path.split(os.getcwd())[0])[0])
-
-# prepend the X2Go path (useful for building new packages)
-sys.path = [os.path.normpath(base)] + sys.path
-
-import unittest
-TestRunner = unittest.TextTestRunner
-suite = unittest.TestSuite()
-
-tests = os.listdir(os.curdir)
-tests = [n[:-3] for n in tests if n.startswith('test') and n.endswith('.py')]
-
-for test in tests:
-    m = __import__(test)
-    if hasattr(m, 'test_suite'):
-        suite.addTest(m.test_suite())
-
-if __name__ == '__main__':
-    TestRunner().run(suite)
diff --git a/x2go/tests/test_printing.py b/x2go/tests/test_printing.py
deleted file mode 100644
index 9b0b124..0000000
--- a/x2go/tests/test_printing.py
+++ /dev/null
@@ -1,136 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright (C) 2010-2016 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-#
-# Python X2Go is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Python X2Go is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-__package__ = 'x2go.tests'
-__name__    = 'x2go.tests.test_printing'
-
-import unittest
-import tempfile
-
-# Python X2Go modules
-import x2go
-
-class TestX2GoClientPrinting(unittest.TestCase):
-
-    def test_client_printing_dialog(self):
-        _printing = """\
-[General]
-pdfview=true
-showdialog=true
-[print]
-startcmd=false
-command=lpr
-[view]
-open=true
-command=xpdf
-[CUPS]
-defaultprinter=PDF
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print(_printing, file=tf)
-        tf.seek(0)
-        p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name, client_instance='DUMMY')
-        self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionDIALOG)
-        tf.close()
-
-    def test_client_printing_pdfview(self):
-        _printing = """\
-[General]
-pdfview=true
-[print]
-startcmd=false
-command=lpr
-[view]
-open=true
-command=xpdf
-[CUPS]
-defaultprinter=PDF
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print(_printing, file=tf)
-        tf.seek(0)
-        p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name)
-        self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPDFVIEW)
-        tf.close()
-
-    def test_client_printing_pdfsave(self):
-        _printing = """\
-[General]
-pdfview=true
-[print]
-startcmd=false
-command=lpr
-[view]
-open=false
-command=xpdf
-[CUPS]
-defaultprinter=PDF
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print(_printing, file=tf)
-        tf.seek(0)
-        p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name)
-        self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPDFSAVE)
-        tf.close()
-
-    def test_client_printing_print(self):
-        _printing = """\
-[General]
-pdfview=false
-[print]
-startcmd=false
-command=lpr
-[view]
-open=false
-command=xpdf
-[CUPS]
-defaultprinter=PDF
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print(_printing, file=tf)
-        tf.seek(0)
-        p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name)
-        self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPRINT)
-        tf.close()
-
-    def test_client_printing_printcmd(self):
-        _printing = """\
-[General]
-pdfview=false
-[print]
-startcmd=true
-command=lpr
-[view]
-open=false
-command=xpdf
-[CUPS]
-defaultprinter=PDF
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print(_printing, file=tf)
-        tf.seek(0)
-        p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name)
-        self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPRINTCMD)
-        tf.close()
-
-def test_suite():
-    from unittest import TestSuite, makeSuite
-    suite = TestSuite()
-    suite.addTest(makeSuite(TestX2GoClientPrinting))
-    return suite

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/python-x2go.git


More information about the x2go-commits mailing list