예제 #1
0
    def testList(self):
        @registry.register_symbol_modality
        class MySymbolModality(modality.Modality):
            pass

        @registry.register_audio_modality
        class MyAudioModality(modality.Modality):
            pass

        @registry.register_image_modality
        class MyImageModality(modality.Modality):
            pass

        @registry.register_class_label_modality
        class MyClassLabelModality(modality.Modality):
            pass

        expected = [
            "symbol:my_symbol_modality", "audio:my_audio_modality",
            "image:my_image_modality", "class_label:my_class_label_modality"
        ]

        self.assertSetEqual(set(registry.list_modalities()), set(expected))
  def testList(self):

    @registry.register_symbol_modality
    class MySymbolModality(modality.Modality):
      pass

    @registry.register_audio_modality
    class MyAudioModality(modality.Modality):
      pass

    @registry.register_image_modality
    class MyImageModality(modality.Modality):
      pass

    @registry.register_class_label_modality
    class MyClassLabelModality(modality.Modality):
      pass

    expected = [
        "symbol:my_symbol_modality", "audio:my_audio_modality",
        "image:my_image_modality", "class_label:my_class_label_modality"
    ]

    self.assertSetEqual(set(registry.list_modalities()), set(expected))