~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/bench_xml.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 20:51:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1942.
  • Revision ID: john@arbash-meinel.com-20060816205127-30f3c965b98f1ddf
Make benchmark include both writing to a real file, and to a string

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
class BenchXMLSerializer(Benchmark):
25
25
 
26
 
    def test_serialize_kernel_like_inventory(self):
 
26
    def test_serialize_to_string_kernel_like_inventory(self):
27
27
        # Really all we want is a real inventory
28
28
        tree = self.make_kernel_like_committed_tree('.', link_bzr=True)
29
29
 
31
31
        self.time(xml5.serializer_v5.write_inventory_to_string,
32
32
                  tree.basis_tree().inventory)
33
33
 
 
34
    def test_serialize_kernel_like_inventory(self):
 
35
        # Really all we want is a real inventory
 
36
        tree = self.make_kernel_like_committed_tree('.', link_bzr=True)
 
37
 
 
38
        f = open('kernel-like-inventory', 'wb')
 
39
        try:
 
40
            # We want a real tree with lots of file ids and sha strings, etc.
 
41
            self.time(xml5.serializer_v5.write_inventory,
 
42
                      tree.basis_tree().inventory, f)
 
43
        finally:
 
44
            f.close()
 
45