~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/tests/test_sourcepackagename.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:
 
1
# Copyright 2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""Tests for SourcePackageName"""
 
5
 
 
6
__metaclass__ = type
 
7
 
 
8
from testtools.testcase import ExpectedException
 
9
 
 
10
from canonical.testing.layers import DatabaseLayer
 
11
from lp.registry.errors import InvalidName
 
12
from lp.registry.model.sourcepackagename import SourcePackageNameSet
 
13
from lp.testing import TestCase
 
14
 
 
15
 
 
16
class TestSourcePackageNameSet(TestCase):
 
17
 
 
18
    layer = DatabaseLayer
 
19
 
 
20
    def test_invalid_name(self):
 
21
        with ExpectedException(
 
22
            InvalidName,
 
23
            'invalid%20name is not a valid name for a source package.'):
 
24
            SourcePackageNameSet().new('invalid%20name')