~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testfetch.py

  • Committer: Martin Pool
  • Date: 2005-09-05 09:11:03 UTC
  • Revision ID: mbp@sourcefrog.net-20050905091103-1e51e146be0f08b4
- add test for deserialization from a canned XML inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 
 
17
 
import sys
18
 
import os
19
 
 
20
16
import bzrlib.errors
21
17
from bzrlib.selftest.testrevision import make_branches
22
18
from bzrlib.trace import mutter
23
19
from bzrlib.branch import Branch
24
 
from bzrlib.fetch import greedy_fetch
 
20
import sys
 
21
import os
25
22
 
26
23
from bzrlib.selftest import TestCaseInTempDir
27
24
        
28
25
 
29
 
def has_revision(branch, revision_id):
30
 
    try:
31
 
        branch.get_revision_xml_file(revision_id)
32
 
        return True
33
 
    except bzrlib.errors.NoSuchRevision:
34
 
        return False
35
 
 
36
 
 
37
 
 
38
26
class TestFetch(TestCaseInTempDir):
39
 
    def SKIPPED_old_test_fetch(self):
40
 
        """obsolete: new commit code depends on parents being present
41
 
        so the test data no longer suits this test."""
42
 
        
 
27
    def runTest(self):
 
28
        from bzrlib.fetch import greedy_fetch, has_revision
 
29
 
43
30
        def new_branch(name):
44
31
            os.mkdir(name)
45
32
            return Branch(name, init=True)
105
92
 
106
93
if __name__ == '__main__':
107
94
    import unittest
108
 
    unittest.main()
109
 
    
 
95
    sys.exit(unittest.run_suite(unittest.makeSuite()))