def test_execute_command(self):
        self.assertEqual(execute_command(['exit', '2'], shell=True), 2)
        self.assertEqual(execute_command('exit 3', shell=True), 3)
        if os.name == 'nt':
            self.assertEqual(execute_command(['cmd', '/C', 'exit 4'], shell=False), 4)
            self.assertEqual(execute_command(['cmd', '/C', 'echo あい'], shell=False, cmd_encoding='sjis'), 0)
        else:
            self.assertEqual(execute_command(['/bin/sh', '-c', 'exit 4'], shell=False), 4)

            # This code will not pass in non-Japanese Windows OS.
            with self.withAssertOutputFile(
                    os.path.join('tests', 'resources', 'sjis_ja.txt'), expect_file_encoding='sjis',
                    output_encoding='sjis', variables={'quote': '"' if os.name == 'nt' else ''}, replace_linesep=True
            ) as out:
                execute_command('echo "あいうえお"', shell=True, cmd_encoding='sjis', stdout=out)