Changeset 10502 for main/waeup.kofa


Ignore:
Timestamp:
16 Aug 2013, 17:05:17 (11 years ago)
Author:
uli
Message:

pep8, pyflakes.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py

    r10501 r10502  
    44from cStringIO import StringIO
    55from zope.app.testing.xmlrpc import ServerProxy
    6 from zope.component import createObject, getUtility
    7 from zope.component.hooks import setSite
    8 from zope.testbrowser.testing import Browser
    9 from waeup.kofa.app import University
     6from zope.component import getUtility
    107from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser
    11 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
     8from waeup.kofa.testing import FunctionalLayer
    129from waeup.kofa.students.payments import StudentOnlinePayment
    1310from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    1411from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket
     12
    1513
    1614class XMLRPCTests(StudentsFullSetup):
     
    6967        self.assertEqual(result, 'K1000000')
    7068        self.assertEqual(self.student_id, result)
    71         REQUEST_XML="""\
     69        REQUEST_XML = """\
    7270<?xml version="1.0"?>
    7371<methodCall>
     
    7977</params>
    8078</methodCall>"""
    81         RESPONSE_XML="""\
     79        RESPONSE_XML = """\
    8280<?xml version='1.0'?>
    8381<methodResponse>
     
    132130        result = server.get_courses_by_session('Nonsense')
    133131        self.assertEqual(result, None)
    134         REQUEST_XML="""\
     132        REQUEST_XML = """\
    135133<?xml version="1.0"?>
    136134<methodCall>
     
    142140</params>
    143141</methodCall>"""
    144         RESPONSE_XML="""\
     142        RESPONSE_XML = """\
    145143<?xml version='1.0'?>
    146144<methodResponse>
     
    171169        self.assertEqual(result, None)
    172170        result = server.get_students_by_course('CRS1', '2012')
    173         self.assertEqual(result, [['K1000000', '234', 'my adviser', 0],])
     171        self.assertEqual(result, [['K1000000', '234', 'my adviser', 0], ])
    174172        result = server.get_students_by_course('CRS1')
    175         self.assertEqual(result, [['K1000000', '234', 'my adviser', 0],])
     173        self.assertEqual(result, [['K1000000', '234', 'my adviser', 0], ])
    176174        payment = StudentOnlinePayment()
    177175        payment.p_id = 'my-id'
     
    181179        self.student['payments']['my-payment'] = payment
    182180        result = server.get_students_by_course('CRS1')
    183         self.assertEqual(result, [['K1000000', '234', 'my adviser', 12.12],])
    184         REQUEST_XML="""\
     181        self.assertEqual(result, [['K1000000', '234', 'my adviser', 12.12], ])
     182        REQUEST_XML = """\
    185183<?xml version="1.0"?>
    186184<methodCall>
     
    193191</params>
    194192</methodCall>"""
    195         RESPONSE_XML="""\
     193        RESPONSE_XML = """\
    196194<?xml version='1.0'?>
    197195<methodResponse>
     
    220218        self.assertEqual(result,
    221219            ['Anna Tester', 'CERT1', '1234', 'aa@aa.ng'])
    222         REQUEST_XML="""\
     220        REQUEST_XML = """\
    223221<?xml version="1.0"?>
    224222<methodCall>
     
    230228</params>
    231229</methodCall>"""
    232         RESPONSE_XML="""\
     230        RESPONSE_XML = """\
    233231<?xml version='1.0'?>
    234232<methodResponse>
     
    258256        binary = img.read()
    259257        self.assertEqual(binary, result)
    260         REQUEST_XML="""\
     258        REQUEST_XML = """\
    261259<?xml version="1.0"?>
    262260<methodCall>
     
    268266</params>
    269267</methodCall>"""
    270         RESPONSE_XML="""\
     268        RESPONSE_XML = """\
    271269<?xml version='1.0'?>
    272270<methodResponse>
     
    290288        result = server.get_paid_sessions('123')
    291289        self.assertEqual(result, {'2009': 12.12})
    292         REQUEST_XML="""\
     290        REQUEST_XML = """\
    293291<?xml version="1.0"?>
    294292<methodCall>
     
    300298</params>
    301299</methodCall>"""
    302         RESPONSE_XML="""\
     300        RESPONSE_XML = """\
    303301<?xml version='1.0'?>
    304302<methodResponse>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py

    r10489 r10502  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
    18 
    1918import grok
    2019import xmlrpclib
     
    2221from zope.catalog.interfaces import ICatalog
    2322from waeup.kofa.interfaces import IUniversity, IExtFileStore
    24    
     23
    2524
    2625def get_student(students, identifier):
     
    5352#    grok.permissions('waeup.xmlrpc',)
    5453
     54
    5555class StudentsXMLRPC(grok.XMLRPC):
    5656    """Student related XMLRPC webservices.
Note: See TracChangeset for help on using the changeset viewer.