Exemple #1
0
 def test_raise_import_error_when_class_or_attribute_not_found(self):
     with pytest.raises(ImportError):
         import_string('siilo.storages.filesystem.FooBarBaz')
Exemple #2
0
 def test_raise_import_error_when_string_is_not_dotted_path(self):
     with pytest.raises(ImportError):
         import_string('hokus pokus')
Exemple #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
Exemple #4
0
 def test_raise_import_error_when_class_or_attribute_not_found(self):
     with pytest.raises(ImportError):
         import_string('siilo.storages.filesystem.FooBarBaz')
Exemple #5
0
 def test_raise_import_error_when_string_is_not_dotted_path(self):
     with pytest.raises(ImportError):
         import_string('hokus pokus')
Exemple #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