MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / test

Method test

tensorflow/python/training/input_test.py:46–68  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44
45 @test_util.run_deprecated_v1
46 def test(self):
47 temp_dir = self.get_temp_dir()
48 filenames = [os.path.join(temp_dir, n) for n in os.listdir(temp_dir)]
49 additional = [
50 os.path.join(self.get_temp_dir(), "match_filenames.%d" % i)
51 for i in range(3)
52 ]
53 for name in additional:
54 open(name, "w").write("Some contents")
55 filenames = list(set(filenames + additional))
56 with self.cached_session():
57 star = inp.match_filenames_once(os.path.join(self.get_temp_dir(), "*"))
58 question = inp.match_filenames_once(
59 os.path.join(self.get_temp_dir(), "match_filenames.?"))
60 one = inp.match_filenames_once(additional[1])
61 self.evaluate(variables.global_variables_initializer())
62 variables.local_variables_initializer().run()
63 self.assertItemsEqual(
64 map(compat.as_bytes, filenames), self.evaluate(star))
65 self.assertItemsEqual(
66 map(compat.as_bytes, additional), self.evaluate(question))
67 self.assertItemsEqual([compat.as_bytes(additional[1])],
68 self.evaluate(one))
69
70
71class LimitEpochsTest(test_lib.TestCase):

Callers

nothing calls this directly

Calls 7

get_temp_dirMethod · 0.80
rangeFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45
cached_sessionMethod · 0.45
evaluateMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected