Home | Trees | Indices | Help |
|
---|
|
1 # -*- coding: utf-8 -*- 2 3 # Copyright (C) 2010-2015 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 4 # 5 # Python X2Go is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU Affero General Public License as published by 7 # the Free Software Foundation; either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # Python X2Go is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program; if not, write to the 17 # Free Software Foundation, Inc., 18 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 20 import unittest 21 import tempfile 22 23 # Python X2Go modules 24 import x2go 252712829 _printing = """\ 30 [General] 31 pdfview=true 32 showdialog=true 33 [print] 34 startcmd=false 35 command=lpr 36 [view] 37 open=true 38 command=xpdf 39 [CUPS] 40 defaultprinter=PDF 41 """ 42 tf = tempfile.NamedTemporaryFile() 43 print >> tf, _printing 44 tf.seek(0) 45 p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name, client_instance='DUMMY') 46 self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionDIALOG) 47 tf.close()4850 _printing = """\ 51 [General] 52 pdfview=true 53 [print] 54 startcmd=false 55 command=lpr 56 [view] 57 open=true 58 command=xpdf 59 [CUPS] 60 defaultprinter=PDF 61 """ 62 tf = tempfile.NamedTemporaryFile() 63 print >> tf, _printing 64 tf.seek(0) 65 p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name) 66 self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPDFVIEW) 67 tf.close()6870 _printing = """\ 71 [General] 72 pdfview=true 73 [print] 74 startcmd=false 75 command=lpr 76 [view] 77 open=false 78 command=xpdf 79 [CUPS] 80 defaultprinter=PDF 81 """ 82 tf = tempfile.NamedTemporaryFile() 83 print >> tf, _printing 84 tf.seek(0) 85 p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name) 86 self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPDFSAVE) 87 tf.close()8890 _printing = """\ 91 [General] 92 pdfview=false 93 [print] 94 startcmd=false 95 command=lpr 96 [view] 97 open=false 98 command=xpdf 99 [CUPS] 100 defaultprinter=PDF 101 """ 102 tf = tempfile.NamedTemporaryFile() 103 print >> tf, _printing 104 tf.seek(0) 105 p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name) 106 self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPRINT) 107 tf.close()108110 _printing = """\ 111 [General] 112 pdfview=false 113 [print] 114 startcmd=true 115 command=lpr 116 [view] 117 open=false 118 command=xpdf 119 [CUPS] 120 defaultprinter=PDF 121 """ 122 tf = tempfile.NamedTemporaryFile() 123 print >> tf, _printing 124 tf.seek(0) 125 p_action = x2go.backends.printing.X2GoClientPrinting(config_files=tf.name) 126 self.assertEqual(type(p_action.print_action), x2go.printactions.X2GoPrintActionPRINTCMD) 127 tf.close()130 from unittest import TestSuite, makeSuite 131 suite = TestSuite() 132 suite.addTest(makeSuite(TestX2GoClientPrinting)) 133 return suite134
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jul 29 03:04:46 2015 | http://epydoc.sourceforge.net |