Esempio 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')
Esempio n. 2
0
 def test_raise_import_error_when_string_is_not_dotted_path(self):
     with pytest.raises(ImportError):
         import_string('hokus pokus')
Esempio 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
Esempio 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')
Esempio n. 5
0
 def test_raise_import_error_when_string_is_not_dotted_path(self):
     with pytest.raises(ImportError):
         import_string('hokus pokus')
Esempio 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