def test_prints_simple_command_with_non_str(self):

        cmd = [pathlib.Path('foo'), '--bees', 1]
        with record_stdout() as rec:
            proc_utils.print_cmd(cmd)

        exp = 'Final command: \n\nfoo \\\n\t--bees 1\n\n'

        self.assertEqual(''.join(rec.lines), exp)
    def test_prints_simple_command(self):

        cmd = ['foo']
        with record_stdout() as rec:
            proc_utils.print_cmd(cmd)

        exp = 'Final command: \n\nfoo \\\n\n'

        self.assertEqual(''.join(rec.lines), exp)
    def test_prints_complex_command(self):

        cmd = ['foo', 'bar', 'baz']
        with record_stdout() as rec:
            proc_utils.print_cmd(cmd)

        exp = [
            'Final command: \n', '\n', 'foo \\\n', '\tbar \\\n', '\tbaz\n\n'
        ]

        self.assertEqual(''.join(rec.lines), ''.join(exp))
    def test_prints_python_command_with_options(self):

        cmd = ['python2', 'foo', '--bar', 'baz', '-b', 'boff']
        with record_stdout() as rec:
            proc_utils.print_cmd(cmd)

        exp = [
            'Final command: \n', '\n', 'python2 foo \\\n', '\t--bar baz \\\n',
            '\t-b boff\n\n'
        ]

        self.assertEqual(''.join(rec.lines), ''.join(exp))