~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_file_names.py

  • Committer: Robert Collins
  • Date: 2007-08-06 23:49:18 UTC
  • mto: (2592.3.81 repository)
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: robertc@robertcollins.net-20070806234918-xc9w5f86tgjphf9u
Prevent the duplicate additions of names to FileNames collections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
            names.save()
34
34
            self.assertEqual('', t.get_bytes(name))
35
35
        
 
36
    def test_allocate_duplicate_name_errors(self):
 
37
        t = self.get_transport()
 
38
        names = FileNames(t, 'index')
 
39
        names.initialise()
 
40
        names.allocate('0')
 
41
        self.assertRaises(errors.DuplicateKey, names.allocate, '0')
 
42
 
36
43
    def test_allocate_name_does_not_error(self):
37
44
        t = self.get_transport()
38
45
        names = FileNames(t, 'index')