Exemplo n.º 1
0
 def test_raise(self) -> None:
     # arrange
     entry = EntryPoint('Test',
                        '__.does.not.exist',
                        attrs=('UnknownClass', ),
                        dist=_TEST_PLUGIN_DIST)
     # act & assert
     with self.assertRaises(ImportError):
         KnownImageCrawlers._load(entry)
Exemplo n.º 2
0
 def test_success(self) -> None:
     # arrange
     entry = _TEST_PLUGIN_ENTRY
     # act
     loaded = KnownImageCrawlers._load(entry)
     # assert
     self.assertIs(_TEST_PLUGIN_CLASS, loaded)