Skip to content
Permalink
Browse files

Moved testing data and scripts into 'testing' subdirectory

  • Loading branch information
simoncadman committed Mar 9, 2014
1 parent b86ffe7 commit d8d2541d7c1ec81c27bda636d02cac3ecb2d69d3
@@ -17,7 +17,7 @@ install: all
${INSTALL} ${srcdir}/full-test.sh ${prefix}/share/cloudprint-cups/
${INSTALL} ${srcdir}/remove-test.sh ${prefix}/share/cloudprint-cups/
unlink ${prefix}/share/cloudprint-cups/pre-commit.py
${INSTALL} -m 644 ${srcdir}/testfiles/* ${prefix}/share/cloudprint-cups/testfiles/
${INSTALL} -m 644 ${srcdir}/testing/* ${prefix}/share/cloudprint-cups/testing/
${INSTALL} -m 644 ${srcdir}/oauth2client/*.py ${prefix}/share/cloudprint-cups/oauth2client/
mkdir -p ${cupsbackend}
mkdir -p ${cupsdriver}
@@ -32,7 +32,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

requestors, storage = Auth.SetupAuth(False)
@@ -24,7 +24,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

while True:
@@ -29,7 +29,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

def showUsage():
@@ -24,7 +24,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

requestors, storage = Auth.SetupAuth(True)
@@ -23,7 +23,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

requestors, storage = Auth.SetupAuth(True, permissions=['https://www.googleapis.com/auth/cloudprint', 'https://www.googleapis.com/auth/drive.readonly'])
@@ -5,11 +5,16 @@ lib/cloudprint-cups/oauth2client/clientsecrets.py
lib/cloudprint-cups/oauth2client/crypt.py
lib/cloudprint-cups/oauth2client/locked_file.py
lib/cloudprint-cups/oauth2client/multistore_file.py
lib/cloudprint-cups/testfiles/NotPdf.txt
lib/cloudprint-cups/testfiles/Test Page.pdf
lib/cloudprint-cups/testfiles/Test Page.png
lib/cloudprint-cups/testfiles/testppd.ppd
lib/cloudprint-cups/testfiles/capabilitylist
lib/cloudprint-cups/testing/testfiles/NotPdf.txt
lib/cloudprint-cups/testing/testfiles/Test Page.pdf
lib/cloudprint-cups/testing/testfiles/Test Page.png
lib/cloudprint-cups/testing/testfiles/testppd.ppd
lib/cloudprint-cups/testing/testfiles/capabilitylist
lib/cloudprint-cups/testing/test_auth.py
lib/cloudprint-cups/testing/test_backend.py
lib/cloudprint-cups/testing/test_cloudprintrequestor.py
lib/cloudprint-cups/testing/test_mockrequestor.py
lib/cloudprint-cups/testing/test_printer.py
lib/cloudprint-cups/auth.py
lib/cloudprint-cups/backend.py
lib/cloudprint-cups/cloudprintrequestor.py
@@ -19,11 +24,6 @@ lib/cloudprint-cups/listcloudprinters.py
lib/cloudprint-cups/printer.py
lib/cloudprint-cups/reportissues.py
lib/cloudprint-cups/setupcloudprint.py
lib/cloudprint-cups/test_auth.py
lib/cloudprint-cups/test_backend.py
lib/cloudprint-cups/test_cloudprintrequestor.py
lib/cloudprint-cups/test_mockrequestor.py
lib/cloudprint-cups/test_printer.py
lib/cloudprint-cups/upgrade.py
@dirrm lib/cloudprint-cups/testfiles
@dirrm lib/cloudprint-cups/oauth2client
@@ -71,7 +71,7 @@ python2 -m compileall -q -f .
%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/*.pyo
%attr(644, root, lp) %{_usr}/share/cloudprint-cups/*.pyc
%attr(644, root, lp) %{_usr}/share/cloudprint-cups/*.pyo
%attr(644, root, lp) %{_usr}/share/cloudprint-cups/testfiles/*
%attr(644, root, lp) %{_usr}/share/cloudprint-cups/testing/*
%doc %{_usr}/share/cloudprint-cups/COPYING
%doc %{_usr}/share/cloudprint-cups/README.md

@@ -29,7 +29,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

requestors, storage = Auth.SetupAuth(True)
@@ -23,7 +23,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

unattended = False
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -13,14 +13,14 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json, urllib, cups, os, stat, grp, pytest, logging, sys
sys.path.insert(0, ".")

from auth import Auth
import json, urllib, cups, os, stat, grp, pytest, logging
from test_mockrequestor import MockRequestor
from oauth2client import client
from oauth2client import multistore_file
from ccputils import Utils

def setup_function(function):
# setup mock requestors
global requestors
@@ -13,9 +13,10 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os, logging, sys, pytest
sys.path.insert(0, ".")

from ccputils import Utils
import os, logging, sys, pytest

def teardown_function(function):
logging.shutdown()
@@ -45,10 +46,10 @@ def test_SetupLoggingFails():
assert os.path.exists(testLogFile) == False

def test_fileIsPDFFails():
assert Utils.fileIsPDF('testfiles/NotPdf.txt') == False
assert Utils.fileIsPDF('testing/testfiles/NotPdf.txt') == False

def test_fileIsPDFSucceeds():
assert Utils.fileIsPDF('testfiles/Test Page.pdf') == True
assert Utils.fileIsPDF('testing/testfiles/Test Page.pdf') == True

def test_fileIsPDFErrors():
assert Utils.fileIsPDF("-dsadsa") == False
@@ -13,8 +13,9 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json, pytest, logging, sys
sys.path.insert(0, ".")

import json, pytest, logging
from cloudprintrequestor import cloudprintrequestor

global requestor
@@ -13,7 +13,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json, urllib
import json, urllib, sys
sys.path.insert(0, ".")

class MockRequestor:

@@ -13,10 +13,11 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import cups, urllib, logging, sys
sys.path.insert(0, ".")

from printer import Printer
from test_mockrequestor import MockRequestor
import cups, urllib, logging

global requestors, printerItem

@@ -206,7 +207,7 @@ def test_internalName():
# internalCapabilityTests.append( { 'name' : word } )

# load test file and try all those
for filelineno, line in enumerate(open('testfiles/capabilitylist')):
for filelineno, line in enumerate(open('testing/testfiles/capabilitylist')):
internalCapabilityTests.append( { 'name' : line.decode("utf-8") } )

for internalTest in internalCapabilityTests:
@@ -300,23 +301,23 @@ def test_printers():
assert isinstance(printerdetails['printers'][0]['capabilities'], list)

# test submitting job
assert printerItem.submitJob(printerId, 'pdf', 'testfiles/Test Page.pdf', 'Test Page', testprintername ) == True
assert printerItem.submitJob(printerId, 'pdf', 'testfiles/Test Page Doesnt Exist.pdf', 'Test Page', testprintername ) == False
assert printerItem.submitJob(printerId, 'pdf', 'testing/testfiles/Test Page.pdf', 'Test Page', testprintername ) == True
assert printerItem.submitJob(printerId, 'pdf', 'testing/testfiles/Test Page Doesnt Exist.pdf', 'Test Page', testprintername ) == False

# test submitting job with no name
assert printerItem.submitJob(printerId, 'pdf', 'testfiles/Test Page.pdf', '', testprintername ) == True
assert printerItem.submitJob(printerId, 'pdf', 'testfiles/Test Page Doesnt Exist.pdf', '', testprintername ) == False
assert printerItem.submitJob(printerId, 'pdf', 'testing/testfiles/Test Page.pdf', '', testprintername ) == True
assert printerItem.submitJob(printerId, 'pdf', 'testing/testfiles/Test Page Doesnt Exist.pdf', '', testprintername ) == False

# png
assert printerItem.submitJob(printerId, 'png', 'testfiles/Test Page.png', 'Test Page', testprintername ) == True
assert printerItem.submitJob(printerId, 'png', 'testfiles/Test Page Doesnt Exist.png', 'Test Page', testprintername ) == False
assert printerItem.submitJob(printerId, 'png', 'testing/testfiles/Test Page.png', 'Test Page', testprintername ) == True
assert printerItem.submitJob(printerId, 'png', 'testing/testfiles/Test Page Doesnt Exist.png', 'Test Page', testprintername ) == False

# ps
assert printerItem.submitJob(printerId, 'ps', 'testfiles/Test Page.ps', 'Test Page', testprintername ) == False
assert printerItem.submitJob(printerId, 'ps', 'testfiles/Test Page Doesnt Exist.ps', 'Test Page', testprintername ) == False
assert printerItem.submitJob(printerId, 'ps', 'testing/testfiles/Test Page.ps', 'Test Page', testprintername ) == False
assert printerItem.submitJob(printerId, 'ps', 'testing/testfiles/Test Page Doesnt Exist.ps', 'Test Page', testprintername ) == False

# test failure of print job
assert printerItem.submitJob(printerId, 'pdf', 'testfiles/Test Page.pdf', 'FAIL PAGE', testprintername ) == False
assert printerItem.submitJob(printerId, 'pdf', 'testing/testfiles/Test Page.pdf', 'FAIL PAGE', testprintername ) == False

# delete test printer
connection.deletePrinter( testprintername )
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -26,7 +26,7 @@
Utils.SetupLogging()

# line below is replaced on commit
CCPVersion = "20140308 200341"
CCPVersion = "20140309 220149"
Utils.ShowVersion(CCPVersion)

if not os.path.exists("/etc/cloudprint.conf"):

0 comments on commit d8d2541

Please sign in to comment.
You can’t perform that action at this time.