~ubuntu-branches/debian/stretch/bzr-xmloutput/stretch

« back to all changes in this revision

Viewing changes to tests/test_status_xml.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-05-05 17:26:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090505172654-hh5w1j0cv1k8k5km
Tags: 0.8.3+bzr123-1
* Move to section vcs.
* Bump standards version to 3.8.1.
* New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
        self.assertStatus(xml_status, wt)
215
215
 
216
216
        tof = StringIO()
217
 
        self.assertRaises(errors.PathsDoNotExist,
218
 
                          show_tree_status_xml,
219
 
                          wt, specific_files=['bye.c','test.c','absent.c'], 
220
 
                          to_file=tof)
 
217
        show_tree_status_xml(wt, specific_files=['bye.c','test.c','absent.c'], to_file=tof)
 
218
        log_xml = fromstring(tof.getvalue())
 
219
        nonexistents = log_xml.findall('nonexistents/nonexistent')
 
220
        unknowns = log_xml.findall('unknown')
 
221
        self.assertEquals(1, len(nonexistents))
 
222
        self.assertEquals(1, len(unknowns))
221
223
        
222
224
        self.assertStatus(create_xml(wt, {'unknown':[('file', 
223
225
            'directory/hello.c', {})]}), wt, specific_files=['directory'])
254
256
        # files that don't exist in either the basis tree or working tree
255
257
        # should give an error
256
258
        wt = self.make_branch_and_tree('.')
257
 
        out, err = self.run_bzr('xmlstatus does-not-exist', retcode=3)
258
 
        self.assertContainsRe(err, r'do not exist.*does-not-exist')
 
259
        out, err = self.run_bzr('xmlstatus does-not-exist')
 
260
        log_xml = fromstring(out)
 
261
        status = log_xml.findall('nonexistents/nonexistent')
 
262
        self.assertEquals(1, len([elem for elem in status]))
 
263
        self.assertEquals(status[0].text, 'does-not-exist')
259
264
 
260
265
    def test_statusxml_out_of_date(self):
261
266
        """Simulate status of out-of-date tree after remote push"""