Exemplo n.º 1
0
 def testCreateTrainRunner(self, mock_runner_constructor):
     mock_create_agent = mock.Mock()
     base_dir = '/tmp'
     train.create_runner(base_dir, mock_create_agent)
     self.assertEqual(1, mock_runner_constructor.call_count)
     mock_args, _ = mock_runner_constructor.call_args
     self.assertEqual(base_dir, mock_args[0])
     self.assertEqual(mock_create_agent, mock_args[1])
Exemplo n.º 2
0
 def testCreateTrainRunner(self, mock_runner_constructor):
   mock_create_agent = mock.Mock()
   base_dir = '/tmp'
   train.create_runner(base_dir, mock_create_agent)
   self.assertEqual(1, mock_runner_constructor.call_count)
   mock_args, _ = mock_runner_constructor.call_args
   self.assertEqual(base_dir, mock_args[0])
   self.assertEqual(mock_create_agent, mock_args[1])
Exemplo n.º 3
0
 def testCreateRunnerUnknown(self, mock_runner_constructor):
     mock_create_agent = mock.Mock()
     base_dir = '/tmp'
     FLAGS.schedule = 'unknown_schedule'
     with self.assertRaisesRegexp(ValueError, 'Unknown schedule'):
         train.create_runner(base_dir, mock_create_agent)
Exemplo n.º 4
0
 def testCreateRunnerUnknown(self, mock_runner_constructor):
   mock_create_agent = mock.Mock()
   base_dir = '/tmp'
   FLAGS.schedule = 'unknown_schedule'
   with self.assertRaisesRegexp(ValueError, 'Unknown schedule'):
     train.create_runner(base_dir, mock_create_agent)