コード例 #1
0
    def testOwnerStringOnSubClass(self):
        @decorators.Owner(emails=['*****@*****.**'], component='comp')
        class Car(object):
            pass

        class Ford(Car):
            pass

        self.assertEquals(['*****@*****.**'], decorators.GetEmails(Car))
        self.assertEquals('comp', decorators.GetComponent(Car))
        self.assertFalse(decorators.GetEmails(Ford))
        self.assertFalse(decorators.GetComponent(Ford))
コード例 #2
0
    def testOwnerStringOnClass(self):
        @decorators.Owner(emails=['*****@*****.**'])
        class Ford(object):
            pass

        self.assertEquals(['*****@*****.**'], decorators.GetEmails(Ford))

        @decorators.Owner(emails=['*****@*****.**'])
        @decorators.Owner(component='component')
        class Honda(object):
            pass

        self.assertEquals(['*****@*****.**'], decorators.GetEmails(Honda))
        self.assertEquals('component', decorators.GetComponent(Honda))
        self.assertEquals(['*****@*****.**'], decorators.GetEmails(Ford))
コード例 #3
0
  def testInfoStringOnSubClass(self):

    @decorators.Info(emails=['*****@*****.**'], component='comp',
                     documentation_url='https://car.com')
    class Car(object):
      pass

    class Ford(Car):
      pass

    self.assertEquals(['*****@*****.**'], decorators.GetEmails(Car))
    self.assertEquals('comp', decorators.GetComponent(Car))
    self.assertEquals('https://car.com', decorators.GetDocumentationLink(Car))
    self.assertFalse(decorators.GetEmails(Ford))
    self.assertFalse(decorators.GetComponent(Ford))
    self.assertFalse(decorators.GetDocumentationLink(Ford))
コード例 #4
0
ファイル: benchmark.py プロジェクト: zupu8/AppleTrace
    def GetOwners(self):
        """Returns a Generic Diagnostic containing the benchmark's owners' emails
       in a list.

    Returns:
      Diagnostic with a list of the benchmark's owners' emails
    """
        return histogram.GenericSet(decorators.GetEmails(self) or [])
コード例 #5
0
    def GetOwnership(self):
        """Returns an Ownership Diagnostic containing the benchmark's information.

    Returns:
      Diagnostic with the benchmark's owners' e-mails and component name
    """
        return histogram.Ownership(decorators.GetEmails(self),
                                   decorators.GetComponent(self))
コード例 #6
0
  def testInfoWithDuplicateAttributeSetting(self):

    with self.assertRaises(AssertionError):
      @decorators.Info(emails=['*****@*****.**'])
      @decorators.Info(emails=['*****@*****.**'], component='comp')
      class Car(object):
        pass

      self.assertEquals(['*****@*****.**'], decorators.GetEmails(Car))
コード例 #7
0
def get_all_benchmarks_metadata(metadata):
  benchmark_list = current_benchmarks()

  for benchmark in benchmark_list:
    emails = decorators.GetEmails(benchmark)
    if emails:
      emails = ', '.join(emails)
    metadata[benchmark.Name()] = BenchmarkMetadata(
        emails, decorators.GetComponent(benchmark), False)
  return metadata
コード例 #8
0
  def testInfoStringOnClass(self):

    @decorators.Info(emails=['*****@*****.**'],
                     documentation_url='http://foo.com')
    class Ford(object):
      pass

    self.assertEquals(['*****@*****.**'], decorators.GetEmails(Ford))

    @decorators.Info(emails=['*****@*****.**'])
    @decorators.Info(component='component',
                     documentation_url='http://bar.com')
    class Honda(object):
      pass

    self.assertEquals(['*****@*****.**'], decorators.GetEmails(Honda))
    self.assertEquals('http://bar.com', decorators.GetDocumentationLink(Honda))
    self.assertEquals('component', decorators.GetComponent(Honda))
    self.assertEquals(['*****@*****.**'], decorators.GetEmails(Ford))
    self.assertEquals('http://foo.com', decorators.GetDocumentationLink(Ford))
コード例 #9
0
ファイル: perf_data_generator.py プロジェクト: xincun/yxbase
def get_all_benchmarks_metadata(metadata):
    benchmark_list = current_benchmarks()

    for benchmark in benchmark_list:
        disabled = 'all' in decorators.GetDisabledAttributes(benchmark)

        emails = decorators.GetEmails(benchmark)
        if emails:
            emails = ', '.join(emails)
        metadata[benchmark.Name()] = BenchmarkMetadata(
            emails, decorators.GetComponent(benchmark), disabled)
    return metadata
コード例 #10
0
def _get_telemetry_perf_benchmarks_metadata():
    metadata = {}
    benchmark_list = benchmark_finders.GetAllPerfBenchmarks()

    for benchmark in benchmark_list:
        emails = decorators.GetEmails(benchmark)
        if emails:
            emails = ', '.join(emails)
        tags_set = benchmark_utils.GetStoryTags(benchmark())
        metadata[benchmark.Name()] = BenchmarkMetadata(
            emails, decorators.GetComponent(benchmark),
            decorators.GetDocumentationLink(benchmark), ','.join(tags_set))
    return metadata
コード例 #11
0
def _get_telemetry_perf_benchmarks_metadata():
    metadata = {}
    for benchmark in benchmark_finders.GetOfficialBenchmarks():
        benchmark_name = benchmark.Name()
        emails = decorators.GetEmails(benchmark)
        if emails:
            emails = ', '.join(emails)
        metadata[benchmark_name] = BenchmarkMetadata(
            emails=emails,
            component=decorators.GetComponent(benchmark),
            documentation_url=decorators.GetDocumentationLink(benchmark),
            stories=benchmark_utils.GetBenchmarkStoryInfo(benchmark()))
    return metadata
コード例 #12
0
def get_all_benchmarks_metadata(metadata):
    benchmark_list = current_benchmarks()

    for benchmark in benchmark_list:
        emails = decorators.GetEmails(benchmark)
        if emails:
            emails = ', '.join(emails)
        tags_set = benchmark_utils.GetStoryTags(benchmark())
        metadata[benchmark.Name()] = BenchmarkMetadata(
            emails, decorators.GetComponent(benchmark),
            decorators.GetDocumentationLink(benchmark), ','.join(tags_set),
            False)
    return metadata
コード例 #13
0
def get_all_benchmarks_metadata(metadata):
  benchmark_list = current_benchmarks()

  for benchmark in benchmark_list:
    exp = benchmark().GetExpectations()
    disabled = 'all' in decorators.GetDisabledAttributes(benchmark) or any(
        any(isinstance(condition, expectations.ALL.__class__)
            for condition in conditions)
        for (conditions, _) in exp.disabled_platforms)

    emails = decorators.GetEmails(benchmark)
    if emails:
      emails = ', '.join(emails)
    metadata[benchmark.Name()] = BenchmarkMetadata(
        emails, decorators.GetComponent(benchmark), disabled)
  return metadata
コード例 #14
0
ファイル: benchmark.py プロジェクト: sretineni/catapult
 def GetOwners(self):
     """Return the benchmark's owners' emails in a list."""
     return decorators.GetEmails(self)