~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/codehosting/vfs/tests/test_branchfs.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-15 13:18:37 UTC
  • mfrom: (13662.5.6 push-creates-package)
  • Revision ID: launchpad@pqm.canonical.com-20110815131837-cp2nb9wc52fswn67
[r=adeuring][bug=386596] Push creates source package names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
from twisted.internet import defer
50
50
 
51
51
from canonical.launchpad.webapp import errorlog
52
 
from canonical.launchpad.webapp.errorlog import ErrorReportingUtility
53
52
from canonical.testing.layers import (
54
53
    ZopelessDatabaseLayer,
55
54
    )
798
797
            errors.PermissionDenied, message,
799
798
            transport.mkdir, '~%s/%s/some-name' % (person.name, product.name))
800
799
 
 
800
    def test_createBranch_invalid_package_name(self):
 
801
        # When createBranch raises faults.InvalidSourcePackageName, the
 
802
        # transport should translate this to a PermissionDenied exception
 
803
        transport = self.getTransport()
 
804
        series = self.factory.makeDistroSeries()
 
805
        unique_name = '~%s/%s/%s/spaced%%20name/branch' % (
 
806
            self.requester.name, series.distribution.name, series.name)
 
807
        return self.assertFiresFailureWithSubstring(
 
808
            errors.PermissionDenied, "is not a valid source package name",
 
809
            transport.mkdir, unique_name)
 
810
 
801
811
    def test_rmdir(self):
802
812
        transport = self.getTransport()
803
813
        self.assertFiresFailure(
1155
1165
        self.addCleanup(memory_server.stop_server)
1156
1166
        return memory_server
1157
1167
 
1158
 
    def _setUpLaunchpadServer(self, user_id, codehosting_api, backing_transport):
 
1168
    def _setUpLaunchpadServer(self, user_id, codehosting_api,
 
1169
                              backing_transport):
1159
1170
        server = LaunchpadServer(
1160
1171
            XMLRPCWrapper(codehosting_api), user_id, backing_transport)
1161
1172
        server.start_server()