/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: Vincent Ladeuil
  • Date: 2009-01-18 18:32:32 UTC
  • mto: (0.152.55 trunk)
  • mto: This revision was merged to the branch mainline in revision 6649.
  • Revision ID: v.ladeuil+lp@free.fr-20090118183232-tfybfzy4azslyew5
Testing against remote branch and testing full/incremental are different.

* tests/test_upload.py:
(load_tests): Oops, add forgotten
TestUploadFromRemoteBranch. Delete TestFullUploadFromRemote and
TestIncrementalUploadFromRemote.
(TestUploadFromRemote, TestFullUploadFromRemote,
TestIncrementalUploadFromRemote): Deleted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
    is_testing_for_transports = tests.condition_isinstance(
102
102
        (TestFullUpload,
103
103
         TestIncrementalUpload,
104
 
         TestFullUploadFromRemote,
105
 
         TestIncrementalUploadFromRemote))
 
104
         TestUploadFromRemoteBranch))
106
105
    transport_adapter = TransportAdapter()
107
106
 
108
107
    is_testing_for_branches = tests.condition_isinstance(
580
579
        self.assertUpFileEqual('bar', 'hello')
581
580
 
582
581
 
583
 
class TestUploadFromRemote(TestUploadMixin):
584
 
 
585
 
    def do_full_upload(self, *args, **kwargs):
586
 
        up_url = self.get_url(self.upload_dir)
587
 
        self.run_bzr(['push', up_url, '--directory=branch'])
588
 
 
589
 
        upload = self._get_cmd_upload()
590
 
        if kwargs.get('directory', None) is None:
591
 
            kwargs['directory'] = up_url
592
 
        kwargs['full'] = True
593
 
        kwargs['quiet'] = True
594
 
        upload.run(up_url, *args, **kwargs)
595
 
 
596
 
    def do_incremental_upload(self, *args, **kwargs):
597
 
        up_url = self.get_url(self.upload_dir)
598
 
        self.run_bzr(['push', up_url, '--directory=branch'])
599
 
 
600
 
        upload = self._get_cmd_upload()
601
 
        if kwargs.get('directory', None) is None:
602
 
            kwargs['directory'] = up_url
603
 
        kwargs['quiet'] = True
604
 
        upload.run(up_url, *args, **kwargs)
605
 
 
606
 
    def test_no_upload_when_changes(self):
607
 
        raise tests.TestNotApplicable()
608
 
 
609
 
    def test_no_upload_when_conflicts(self):
610
 
        raise tests.TestNotApplicable()
611
 
 
612
 
    remote_branch = None
613
 
    def get_upload_auto(self):
614
 
        if not self.remote_branch:
615
 
            self.remote_branch = branch.Branch.open_from_transport(\
616
 
                self.get_transport(self.upload_dir))
617
 
 
618
 
        return get_upload_auto(self.remote_branch)
619
 
 
620
 
 
621
 
class TestFullUploadFromRemote(tests.TestCaseWithTransport,
622
 
                               TestUploadFromRemote):
623
 
 
624
 
    do_upload = TestUploadFromRemote.do_full_upload
625
 
 
626
 
 
627
 
class TestIncrementalUploadFromRemote(tests.TestCaseWithTransport,
628
 
                                      TestUploadFromRemote):
629
 
 
630
 
    do_upload = TestUploadFromRemote.do_incremental_upload
631
 
 
632
 
 
633
582
class TestBranchUploadLocations(branch_implementations.TestCaseWithBranch):
634
583
 
635
584
    def test_get_upload_location_unset(self):