def test_existing_correct_file(self): """ Test that the function can parse a valid env file """ env = get_env("tests/tests_assets/valid_env.env") self.assertEqual(env["YOLO"], "swagg") self.assertEqual(env["N"], 42) self.assertEqual(env["PI"], 3.14) self.assertEqual(env["FOO"], "bar")
Please see the tutorial and website for how to download the CIFAR-10 data set, compile the program and train the model. http://tensorflow.org/tutorials/deep_cnn/ """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import time import tensorflow as tf from env_functions import get_env env = get_env() import veka # flag = command line options # https://www.quora.com/What-are-flags-used-for-in-TensorFlow FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string( 'train_dir', env['TRAIN_DIR'], """Directory where to write event logs """ """and checkpoint.""") tf.app.flags.DEFINE_integer('max_steps', env['MAX_STEPS_ON_TRAIN'], """Number of batches to run.""") tf.app.flags.DEFINE_boolean('log_device_placement', False, """Whether to log device placement.""") tf.app.flags.DEFINE_integer('log_frequency', env['LOG_FREQUENCY_ON_TRAIN'], """How often to log results to the console.""")
def test_unexisting_file(self): """ Test that the function return default values when no env file """ with self.assertRaises(FileNotFoundError): get_env("foo/bar.env")
def test_existing_uncorrect_file(self): """ Test that the function fill the dic only with valid lines """ env = get_env("tests/tests_assets/not_valid_env.env") self.assertEqual(env["YOLO"], "swagg") self.assertEqual(env["FOO"], "bar")