Skip to content

Commit 6b1d8db

Browse files
mattiagiupponigiohappy
authored andcommitted
[Fixes #14339] Drop support Dropbox storage manager
1 parent 2b7c0ff commit 6b1d8db

3 files changed

Lines changed: 0 additions & 149 deletions

File tree

geonode/storage/dropbox.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

geonode/storage/tests.py

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -30,94 +30,10 @@
3030
from geonode.storage.exceptions import DataRetrieverExcepion
3131
from geonode.storage.manager import StorageManager
3232
from geonode.storage.gcs import GoogleStorageManager
33-
from geonode.storage.dropbox import DropboxStorageManager
3433
from geonode.base.populate_test_data import create_single_dataset
3534
from geonode.tests.base import GeoNodeBaseTestSupport
3635

3736

38-
class TestDropboxStorageManager(SimpleTestCase):
39-
def setUp(self):
40-
with self.settings(DROPBOX_OAUTH2_TOKEN="auth_token"):
41-
self.sut = DropboxStorageManager()
42-
43-
@patch("geonode.storage.dropbox.DropBoxStorage.delete")
44-
def test_dropbox_deleted(self, dbx):
45-
"""
46-
Will test that the function returns the expected result
47-
and that the DropBoxStorage function as been called with the expected parameters
48-
"""
49-
dbx.return_value = None
50-
output = self.sut.delete("filename")
51-
self.assertIsNone(output)
52-
dbx.assert_called_once_with("filename")
53-
54-
@patch("geonode.storage.dropbox.DropBoxStorage.exists")
55-
def test_dropbox_exists(self, dbx):
56-
"""
57-
Will test that the function returns the expected result
58-
and that the DropBoxStorage function as been called with the expected parameters
59-
"""
60-
dbx.return_value = True
61-
output = self.sut.exists("filename")
62-
self.assertTrue(output)
63-
dbx.assert_called_once_with("filename")
64-
65-
@patch("geonode.storage.dropbox.DropBoxStorage.listdir")
66-
def test_dropbox_listdir(self, dbx):
67-
"""
68-
Will test that the function returns the expected result
69-
and that the DropBoxStorage function as been called with the expected parameters
70-
"""
71-
dbx.return_value = (["folder1"], ["file1", "file2"])
72-
output = self.sut.listdir("Apps/")
73-
self.assertTupleEqual((["folder1"], ["file1", "file2"]), output)
74-
dbx.assert_called_once_with("Apps/")
75-
76-
@patch("geonode.storage.dropbox.DropBoxStorage._open")
77-
def test_dropbox_open(self, dbx):
78-
"""
79-
Will test that the function returns the expected result
80-
and that the DropBoxStorage function as been called with the expected parameters
81-
"""
82-
dbx.return_value = io.StringIO()
83-
output = self.sut.open("name", mode="xx")
84-
self.assertEqual(type(output), io.StringIO().__class__)
85-
dbx.assert_called_once_with("name", "xx")
86-
87-
@patch("geonode.storage.dropbox.DropBoxStorage._full_path")
88-
def test_dropbox_path(self, dbx):
89-
"""
90-
Will test that the function returns the expected result
91-
and that the DropBoxStorage function as been called with the expected parameters
92-
"""
93-
dbx.return_value = "/opt/full/path/to/file"
94-
output = self.sut.path("file")
95-
self.assertEqual("/opt/full/path/to/file", output)
96-
dbx.assert_called_once_with("file")
97-
98-
@patch("geonode.storage.dropbox.DropBoxStorage.save")
99-
def test_dropbox_save(self, dbx):
100-
"""
101-
Will test that the function returns the expected result
102-
and that the DropBoxStorage function as been called with the expected parameters
103-
"""
104-
dbx.return_value = "cleaned_name"
105-
output = self.sut.save("file_name", "content")
106-
self.assertEqual("cleaned_name", output)
107-
dbx.assert_called_once_with("file_name", "content")
108-
109-
@patch("geonode.storage.dropbox.DropBoxStorage.size")
110-
def test_dropbox_size(self, dbx):
111-
"""
112-
Will test that the function returns the expected result
113-
and that the DropBoxStorage function as been called with the expected parameters
114-
"""
115-
dbx.return_value = 1
116-
output = self.sut.size("name")
117-
self.assertEqual(1, output)
118-
dbx.assert_called_once_with("name")
119-
120-
12137
class TestGoogleStorageManager(SimpleTestCase):
12238
def setUp(self):
12339
self.sut = GoogleStorageManager

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ dependencies = [
116116
"django-bootstrap3-datetimepicker-2==2.8.3",
117117
# storage manager dependencies
118118
"django-storages==1.14.3",
119-
"dropbox==11.36.2",
120119
"google-cloud-storage==2.16.0",
121120
"boto3==1.39.3",
122121
# Django Caches

0 commit comments

Comments
 (0)