~piastucki/bzr-xmloutput/fix-auth

« back to all changes in this revision

Viewing changes to tests/test_ls_xml.py

  • Committer: Guillermo Gonzalez
  • Date: 2011-03-09 23:27:29 UTC
  • mfrom: (152.1.2 fix-482919)
  • Revision ID: guillo.gonzo@gmail.com-20110309232729-bzydnlbip02qzu4h
Fix --null support in xmlls command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib import ignores
22
22
from bzrlib.tests import TestCaseWithTransport
23
 
from bzrlib.trace import mutter
24
23
from bzrlib.xml_serializer import elementtree as elementtree
25
24
fromstring = elementtree.ElementTree.fromstring
26
25
 
61
60
    #    self.run_bzr_error(['Cannot set both --verbose and --null'],
62
61
    #                       'xmlls --verbose --null')
63
62
 
 
63
    def test_null_arg(self):
 
64
        """Test that null arg is accepted."""
 
65
        command = 'xmlls --null'
 
66
        out, err = self.run_bzr(command)
 
67
        self.assertEqual('', err)
 
68
        self.assertEqual(out[-2], '\0')
 
69
 
64
70
    def test_lsxml_basic(self):
65
71
        """Test the abilities of 'bzr xmlls'"""
66
72
        expected_items = [{'kind': 'file',
90
96
                           'path': 'a',
91
97
                           'status_kind': 'versioned'}]
92
98
        self.assertEquals(expected_items, self.run_xmlls())
93
 
        
 
99
 
94
100
        self.wt.commit('add')
95
101
        self.build_tree(['subdir/'])
96
102
        expected_items = [{'kind': 'file',
104
110
                           'path': 'subdir',
105
111
                           'status_kind': 'unknown'}]
106
112
        self.assertEquals(expected_items, self.run_xmlls())
107
 
        
 
113
 
108
114
        self.build_tree(['subdir/b'])
109
115
        self.wt.add(['subdir/', 'subdir/b', '.bzrignore'],
110
116
            ['subdir-id', 'subdirb-id', 'bzrignore-id'])