Exemple #1
0
 def _create_artifact_cache(self, spec, action):
   if len(spec) > 0:
     pants_workdir = self.context.config.getdefault('pants_workdir')
     my_name = self.__class__.__name__
     return create_artifact_cache(self.context.log, pants_workdir, spec, my_name, action)
   else:
     return None
Exemple #2
0
 def _create_artifact_cache(self, spec, action):
   if len(spec) > 0:
     pants_workdir = self.context.config.getdefault('pants_workdir')
     my_name = self.__class__.__name__
     return create_artifact_cache(self.context.log, pants_workdir, spec, my_name, action)
   else:
     return None
Exemple #3
0
 def mk_cache(spec):
     return create_artifact_cache(MockLogger(),
                                  artifact_root,
                                  spec,
                                  'TestTask',
                                  compression=1,
                                  action='testing')
Exemple #4
0
 def _create_artifact_cache(self, spec, action):
   if len(spec) > 0:
     pants_workdir = self.context.options.for_global_scope().pants_workdir
     compression = self.context.config.getint('cache', 'compression', default=5)
     my_name = self.__class__.__name__
     return create_artifact_cache(
       log=self.context.log,
       artifact_root=pants_workdir,
       spec=spec,
       task_name=my_name,
       compression=compression,
       action=action)
   else:
     return None
 def check(expected_type, spec):
   cache = create_artifact_cache(MockLogger(), artifact_root, spec, 'TestTask', 'testing')
   self.assertTrue(isinstance(cache, expected_type))
   self.assertEquals(cache.artifact_root, artifact_root)
 def mk_cache(spec):
   return create_artifact_cache(MockLogger(), artifact_root, spec,
                               'TestTask', compression=1, action='testing')
Exemple #7
0
 def check(expected_type, spec):
     cache = create_artifact_cache(MockLogger(), artifact_root, spec,
                                   'TestTask', 'testing')
     self.assertTrue(isinstance(cache, expected_type))
     self.assertEquals(cache.artifact_root, artifact_root)