import tensorflow as tf


import tempfile

import tensorflow as tf


class IoOpsTest(tf.test.TestCase):

  def testReadFile(self):
    cases = ['', 'Some contents', 'Неки садржаји на српском']
    for contents in cases:
      contents = tf.compat.as_bytes(contents)
      temp = tempfile.NamedTemporaryFile(prefix='ReadFileTest')
      open(temp.name, 'wb').write(contents)
      with self.test_session():
        read = tf.read_file(temp.name)
        self.assertEqual([], read.get_shape())
        self.assertEqual(read.eval(), contents)

  def _subset(self, files, indices):
    return set(tf.compat.as_bytes(files[i].name)
               for i in range(len(files)) if i in indices)
