Exemple #1
0
    def test_get_location_help_default(self):
        class Locator:
            """ Some default documentation."""
            pass

        registry = TargetRegistry()
        registry.register_location(
            target_class=float,
            locator_class=Locator,
            solver=lambda w, l: 1,
        )

        help_text = registry._get_location_doc(
            target=2.345,
            locator_class=Locator,
        )
        self.assertEqual(help_text, "Some default documentation.")
Exemple #2
0
 def test_error_get_interaction_doc(self):
     # The registry is empty
     registry = TargetRegistry()
     with self.assertRaises(LocationNotSupported):
         registry._get_location_doc(3.456, int)