import tensorflow as tf

class StringToASCIIOp(tf.test.TestCase):
    def runTest(self):
        members = set(dir(self.__class__)) - set(dir(tf.test.TestCase))
        members.remove('runTest')
        rList = []
        for mem in members:
            rList.append(eval('self.' + mem + '()'))
        return rList
    def oneDTest(self):
        print "oneDTest..."
        strings = tf.constant(['a', 'b','cd'])
        ints = tf.user_ops.string_to_ascii(strings)
        with tf.Session() as sess:
            strs = sess.run([ints])
            for s in strs:
                print str(s) + '\n=============='

    def twoDTest(self):
        print "twoDTest..."
        strings = tf.constant([ ['a&', '','cd'], ['jkls,', 'dkdj', 'a'] ])
        ints = tf.user_ops.string_to_ascii(strings)
        with tf.Session() as sess:
            strs = sess.run([ints])
            for s in strs:
                print str(s) + '\n=============='



if __name__ == "__main__":
    test = StringToASCIIOp()
    testList = test.runTest()
