Пример #1
0
 def testExecutorModuleFileNotProvided(self):
     input_dict = {}
     output = standard_artifacts.DataView()
     output.uri = os.path.join(self._output_data_dir, 'output_data_view')
     output_dict = {'data_view': output}
     exec_properties = {
         'create_decoder_func':
         '%s.%s' % (data_view_module.create_simple_decoder.__module__,
                    data_view_module.create_simple_decoder.__name__),
     }
     executor = provider_executor.TfGraphDataViewProviderExecutor()
     executor.Do(input_dict, output_dict, exec_properties)
     loaded_decoder = tf_graph_record_decoder.load_decoder(output.uri)
     self.assertIsInstance(loaded_decoder,
                           tf_graph_record_decoder.TFGraphRecordDecoder)
Пример #2
0
 def testExecutorModuleFileProvided(self):
   input_dict = {}
   output = standard_artifacts.DataView()
   output.uri = os.path.join(self._output_data_dir, 'output_data_view')
   output_dict = {'data_view': [output]}
   exec_properties = {
       'module_file':
           os.path.join(self._source_data_dir,
                        'module_file/data_view_module.py'),
       'create_decoder_func':
           'create_simple_decoder',
   }
   executor = provider_executor.TfGraphDataViewProviderExecutor()
   executor.Do(input_dict, output_dict, exec_properties)
   loaded_decoder = tf_graph_record_decoder.load_decoder(output.uri)
   self.assertIsInstance(
       loaded_decoder, tf_graph_record_decoder.LoadedDecoder)