/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tests/test_upload.py

  • Committer: Gary van der Merwe
  • Date: 2009-01-11 23:15:04 UTC
  • mto: (0.152.55 trunk)
  • mto: This revision was merged to the branch mainline in revision 6649.
  • Revision ID: garyvdm@gmail.com-20090111231504-qkhsly131cmqsbeh
Add a check to make sure we are not uploading to an existing wt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    )
41
41
 
42
42
 
43
 
from bzrlib.plugins.upload import cmd_upload, BzrUploader, get_upload_auto
 
43
from bzrlib.plugins.upload import (
 
44
    cmd_upload,
 
45
    BzrUploader,
 
46
    get_upload_auto,
 
47
    CannotUploadToWT,
 
48
    )
44
49
 
45
50
 
46
51
class TransportAdapter(
457
462
        self.tree.commit("Add directory")
458
463
        self.do_full_upload(directory='branch/foo')
459
464
 
 
465
    def test_no_upload_remote_wt(self):
 
466
        self.make_local_branch()
 
467
        self.add_file('hello', 'foo')
 
468
 
 
469
        #Create branch in remote tree to create wt
 
470
        t = transport.get_transport(self.upload_dir)
 
471
        self.branch = bzrdir.BzrDir.create_branch_convenience(
 
472
            t.base,
 
473
            format=bzrdir.format_registry.make_bzrdir('default'),
 
474
            force_new_tree=True)
 
475
 
 
476
        self.assertRaises(CannotUploadToWT, self.do_upload)
 
477
 
460
478
 
461
479
class TestFullUpload(tests.TestCaseWithTransport, TestUploadMixin):
462
480