'2to3 a single directory with a new output dir and suffix.'

def test_filename_changing_on_output_single_dir(self):

    self.setup_test_source_trees()
    out = StringIO.StringIO()
    err = StringIO.StringIO()
    suffix = 'TEST'
    ret = self.run_2to3_capture(['-n', '--add-suffix', suffix, '--write-unchanged-files', '--no-diffs', '--output-dir', self.py3_dest_dir, self.py2_src_dir], StringIO.StringIO(''), out, err)
    self.assertEqual(ret, 0)
    stderr = err.getvalue()
    self.assertIn('    implies    -w.', stderr)
    self.assertIn(('Output    in    %r    will    mirror    the    input    directory    %r    layout' % (self.py3_dest_dir, self.py2_src_dir)), stderr)
    self.assertEqual(set(((name + suffix) for name in self.setup_files)), set(os.listdir(self.py3_dest_dir)))
    for name in self.setup_files:
        self.assertIn(('Writing    converted    %s    to    %s' % (os.path.join(self.py2_src_dir, name), os.path.join(self.py3_dest_dir, (name + suffix)))), stderr)
    sep = re.escape(os.sep)
    self.assertRegexpMatches(stderr, 'No    changes    to    .*/__init__\\.py'.replace('/', sep))
    self.assertNotRegex(stderr, 'No    changes    to    .*/trivial\\.py'.replace('/', sep))
