예제 #1
0
    def test_get_spec_dependency(self):
        af1 = Metric.from_yaml('AF1', yaml_doc=self.metric_doc)
        dep = af1.get_spec_dependency('design', 'AD1', filter_name='r')

        ad1 = Metric.from_yaml('AD1', yaml_doc=self.metric_doc)

        self.assertEqual(dep.quantity,
                         ad1.get_spec('design', filter_name='r').quantity)
예제 #2
0
    def test_am1_get_spec_names(self):
        """Test get_spec_names against AM1."""
        am1 = Metric.from_yaml('AM1', yaml_doc=self.metric_doc)
        spec_names_all = am1.get_spec_names()
        self.assertTrue(len(spec_names_all) == 3)
        self.assertIn('design', spec_names_all)
        self.assertIn('minimum', spec_names_all)
        self.assertIn('stretch', spec_names_all)

        # No specs for bands other than r and i!
        spec_names_g = am1.get_spec_names(filter_name='g')
        self.assertTrue(len(spec_names_g) == 0)
예제 #3
0
 def test_load_all_yaml_metrics(self):
     """Verify that all metrics from metrics.yaml can be loaded."""
     for metric_name in self.metric_doc:
         m = Metric.from_yaml(metric_name, yaml_doc=self.metric_doc)
         self.assertIsInstance(m, Metric)