# Path: conkit/io/_iotools.py
# def create_tmp_f(content=None, mode="w"):
# def is_str_like(content):
# def open_f_handle(f_handle, mode):


import os
import unittest
from conkit.io import _iotools
from conkit.io.tests.helpers import ParserTestCase
        self.assertEqual(content, written_content)

    def test_create_tmp_f_3(self):
        content = b"Hello, World!"
        fname = self.tempfile(content=content, mode="wb")
        self.assertTrue(os.path.isfile(fname))
        with open(fname, "rb") as f_in:
            written_content = f_in.read()
        self.assertEqual(content, written_content)

    def test_is_str_like_1(self):
        self.assertTrue(_iotools.is_str_like("foo"))  # str
        self.assertFalse(_iotools.is_str_like(1))  # int
        self.assertFalse(_iotools.is_str_like(1.0))  # float
        self.assertFalse(_iotools.is_str_like([]))  # list
        self.assertFalse(_iotools.is_str_like(()))  # tuple
        self.assertFalse(_iotools.is_str_like({}))  # dict
        self.assertFalse(_iotools.is_str_like(set()))  # set

    def test_open_f_handle_1(self):
        fname = self.tempfile()
        with _iotools.open_f_handle(fname, "a") as fhandle:
            self.assertEqual("a", fhandle.mode)
        f_in_handle = _iotools.open_f_handle(fname, "a")
        with _iotools.open_f_handle(f_in_handle, "a") as fhandle:
            self.assertEqual("a", fhandle.mode)
        f_in_handle.close()

    def test_open_f_handle_2(self):
        fname = self.tempfile()

# Path: conkit/io/_iotools.py
# def create_tmp_f(content=None, mode="w"):
# def is_str_like(content):
# def open_f_handle(f_handle, mode):


# Path: conkit/io/tests/test__iotools.py
import os
import unittest
from conkit.io import _iotools
from conkit.io.tests.helpers import ParserTestCase

        self.assertEqual(content, written_content)

    def test_create_tmp_f_3(self):
        content = b"Hello, World!"
        fname = self.tempfile(content=content, mode="wb")
        self.assertTrue(os.path.isfile(fname))
        with open(fname, "rb") as f_in:
            written_content = f_in.read()
        self.assertEqual(content, written_content)

    def test_is_str_like_1(self):
        self.assertTrue(_iotools.is_str_like("foo"))  # str
        self.assertFalse(_iotools.is_str_like(1))  # int
        self.assertFalse(_iotools.is_str_like(1.0))  # float
        self.assertFalse(_iotools.is_str_like([]))  # list
        self.assertFalse(_iotools.is_str_like(()))  # tuple
        self.assertFalse(_iotools.is_str_like({}))  # dict
        self.assertFalse(_iotools.is_str_like(set()))  # set

    def test_open_f_handle_1(self):
        fname = self.tempfile()
        with _iotools.open_f_handle(fname, "a") as fhandle:
            self.assertEqual("a", fhandle.mode)
        f_in_handle = _iotools.open_f_handle(fname, "a")
        with _iotools.open_f_handle(f_in_handle, "a") as fhandle:
            self.assertEqual("a", fhandle.mode)
        f_in_handle.close()

    def test_open_f_handle_2(self):
        fname = self.tempfile()

        with _iotools.open_f_handle(fname, "r") as fhandle: