Exemplo n.º 1
0
 def test_raise_import_error_when_class_or_attribute_not_found(self):
     with pytest.raises(ImportError):
         import_string('siilo.storages.filesystem.FooBarBaz')
Exemplo n.º 2
0
 def test_raise_import_error_when_string_is_not_dotted_path(self):
     with pytest.raises(ImportError):
         import_string('hokus pokus')
Exemplo n.º 3
0
    def test_import_class_from_string(self):
        cls = import_string('siilo.storages.filesystem.FileSystemStorage')

        from siilo.storages.filesystem import FileSystemStorage
        assert cls == FileSystemStorage
Exemplo n.º 4
0
 def test_raise_import_error_when_class_or_attribute_not_found(self):
     with pytest.raises(ImportError):
         import_string('siilo.storages.filesystem.FooBarBaz')
Exemplo n.º 5
0
 def test_raise_import_error_when_string_is_not_dotted_path(self):
     with pytest.raises(ImportError):
         import_string('hokus pokus')
Exemplo n.º 6
0
    def test_import_class_from_string(self):
        cls = import_string('siilo.storages.filesystem.FileSystemStorage')

        from siilo.storages.filesystem import FileSystemStorage
        assert cls == FileSystemStorage