@@ -84,116 +84,116 @@ def test_bot_responds_to_empty_message(self):
84
84
def test_dbx_ls_root (self ):
85
85
bot_response = " - [foo](https://www.dropbox.com/home/foo)\n " \
86
86
" - [boo](https://www.dropbox.com/home/boo)"
87
- with patch ('dropbox.dropbox. Dropbox.files_list_folder' , side_effect = get_root_files_list ), \
87
+ with patch ('dropbox.Dropbox.files_list_folder' , side_effect = get_root_files_list ), \
88
88
self .mock_config_info (self .config_info ):
89
89
self .verify_reply ("ls" , bot_response )
90
90
91
91
def test_dbx_ls_folder (self ):
92
92
bot_response = " - [moo](https://www.dropbox.com/home/foo/moo)\n " \
93
93
" - [noo](https://www.dropbox.com/home/foo/noo)"
94
- with patch ('dropbox.dropbox. Dropbox.files_list_folder' , side_effect = get_folder_files_list ), \
94
+ with patch ('dropbox.Dropbox.files_list_folder' , side_effect = get_folder_files_list ), \
95
95
self .mock_config_info (self .config_info ):
96
96
self .verify_reply ("ls foo" , bot_response )
97
97
98
98
def test_dbx_ls_empty (self ):
99
99
bot_response = '`No files available`'
100
- with patch ('dropbox.dropbox. Dropbox.files_list_folder' , side_effect = get_empty_files_list ), \
100
+ with patch ('dropbox.Dropbox.files_list_folder' , side_effect = get_empty_files_list ), \
101
101
self .mock_config_info (self .config_info ):
102
102
self .verify_reply ("ls" , bot_response )
103
103
104
104
def test_dbx_ls_error (self ):
105
105
bot_response = "Please provide a correct folder path\n " \
106
106
"Usage: `ls <foldername>` to list folders in directory\n " \
107
107
"or simply `ls` for listing folders in the root directory"
108
- with patch ('dropbox.dropbox. Dropbox.files_list_folder' , side_effect = Exception ()), \
108
+ with patch ('dropbox.Dropbox.files_list_folder' , side_effect = Exception ()), \
109
109
self .mock_config_info (self .config_info ):
110
110
self .verify_reply ("ls" , bot_response )
111
111
112
112
def test_dbx_mkdir (self ):
113
113
bot_response = "CREATED FOLDER: [foo](https://www.dropbox.com/home/foo)"
114
- with patch ('dropbox.dropbox. Dropbox.files_create_folder' , side_effect = create_file ), \
114
+ with patch ('dropbox.Dropbox.files_create_folder' , side_effect = create_file ), \
115
115
self .mock_config_info (self .config_info ):
116
116
self .verify_reply ('mkdir foo' , bot_response )
117
117
118
118
def test_dbx_mkdir_error (self ):
119
119
bot_response = "Please provide a correct folder path and name.\n " \
120
120
"Usage: `mkdir <foldername>` to create a folder."
121
- with patch ('dropbox.dropbox. Dropbox.files_create_folder' , side_effect = Exception ()), \
121
+ with patch ('dropbox.Dropbox.files_create_folder' , side_effect = Exception ()), \
122
122
self .mock_config_info (self .config_info ):
123
123
self .verify_reply ('mkdir foo/bar' , bot_response )
124
124
125
125
def test_dbx_rm (self ):
126
126
bot_response = "DELETED File/Folder : [foo](https://www.dropbox.com/home/foo)"
127
- with patch ('dropbox.dropbox. Dropbox.files_delete' , side_effect = create_file ), \
127
+ with patch ('dropbox.Dropbox.files_delete' , side_effect = create_file ), \
128
128
self .mock_config_info (self .config_info ):
129
129
self .verify_reply ('rm foo' , bot_response )
130
130
131
131
def test_dbx_rm_error (self ):
132
132
bot_response = "Please provide a correct folder path and name.\n " \
133
133
"Usage: `rm <foldername>` to delete a folder in root directory."
134
- with patch ('dropbox.dropbox. Dropbox.files_delete' , side_effect = Exception ()), \
134
+ with patch ('dropbox.Dropbox.files_delete' , side_effect = Exception ()), \
135
135
self .mock_config_info (self .config_info ):
136
136
self .verify_reply ('rm foo' , bot_response )
137
137
138
138
def test_dbx_write (self ):
139
139
bot_response = "Written to file: [foo](https://www.dropbox.com/home/foo)"
140
- with patch ('dropbox.dropbox. Dropbox.files_upload' , side_effect = create_file ), \
140
+ with patch ('dropbox.Dropbox.files_upload' , side_effect = create_file ), \
141
141
self .mock_config_info (self .config_info ):
142
142
self .verify_reply ('write foo boo' , bot_response )
143
143
144
144
def test_dbx_write_error (self ):
145
145
bot_response = "Incorrect file path or file already exists.\n " \
146
146
"Usage: `write <filename> CONTENT`"
147
- with patch ('dropbox.dropbox. Dropbox.files_upload' , side_effect = Exception ()), \
147
+ with patch ('dropbox.Dropbox.files_upload' , side_effect = Exception ()), \
148
148
self .mock_config_info (self .config_info ):
149
149
self .verify_reply ('write foo boo' , bot_response )
150
150
151
151
def test_dbx_read (self ):
152
152
bot_response = "**foo** :\n boo"
153
- with patch ('dropbox.dropbox. Dropbox.files_download' , side_effect = download_file ), \
153
+ with patch ('dropbox.Dropbox.files_download' , side_effect = download_file ), \
154
154
self .mock_config_info (self .config_info ):
155
155
self .verify_reply ('read foo' , bot_response )
156
156
157
157
def test_dbx_read_error (self ):
158
158
bot_response = "Please provide a correct file path\n " \
159
159
"Usage: `read <filename>` to read content of a file"
160
- with patch ('dropbox.dropbox. Dropbox.files_download' , side_effect = Exception ()), \
160
+ with patch ('dropbox.Dropbox.files_download' , side_effect = Exception ()), \
161
161
self .mock_config_info (self .config_info ):
162
162
self .verify_reply ('read foo' , bot_response )
163
163
164
164
def test_dbx_search (self ):
165
165
bot_response = " - [foo](https://www.dropbox.com/home/foo)\n " \
166
166
" - [fooboo](https://www.dropbox.com/home/fooboo)"
167
- with patch ('dropbox.dropbox. Dropbox.files_search' , side_effect = search_files ), \
167
+ with patch ('dropbox.Dropbox.files_search' , side_effect = search_files ), \
168
168
self .mock_config_info (self .config_info ):
169
169
self .verify_reply ('search foo' , bot_response )
170
170
171
171
def test_dbx_search_empty (self ):
172
172
bot_response = "No files/folders found matching your query.\n " \
173
173
"For file name searching, the last token is used for prefix matching" \
174
174
" (i.e. “bat c” matches “bat cave” but not “batman car”)."
175
- with patch ('dropbox.dropbox. Dropbox.files_search' , side_effect = get_empty_search_result ), \
175
+ with patch ('dropbox.Dropbox.files_search' , side_effect = get_empty_search_result ), \
176
176
self .mock_config_info (self .config_info ):
177
177
self .verify_reply ('search boo --fd foo' , bot_response )
178
178
179
179
def test_dbx_search_error (self ):
180
180
bot_response = "Usage: `search <foldername> query --mr 10 --fd <folderName>`\n " \
181
181
"Note:`--mr <int>` is optional and is used to specify maximun results.\n " \
182
182
" `--fd <folderName>` to search in specific folder."
183
- with patch ('dropbox.dropbox. Dropbox.files_search' , side_effect = Exception ()), \
183
+ with patch ('dropbox.Dropbox.files_search' , side_effect = Exception ()), \
184
184
self .mock_config_info (self .config_info ):
185
185
self .verify_reply ('search foo' , bot_response )
186
186
187
187
def test_dbx_share (self ):
188
188
bot_response = 'http://www.foo.com/boo'
189
- with patch ('dropbox.dropbox. Dropbox.sharing_create_shared_link' , side_effect = get_shared_link ), \
189
+ with patch ('dropbox.Dropbox.sharing_create_shared_link' , side_effect = get_shared_link ), \
190
190
self .mock_config_info (self .config_info ):
191
191
self .verify_reply ('share boo' , bot_response )
192
192
193
193
def test_dbx_share_error (self ):
194
194
bot_response = "Please provide a correct file name.\n " \
195
195
"Usage: `share <filename>`"
196
- with patch ('dropbox.dropbox. Dropbox.sharing_create_shared_link' , side_effect = Exception ()), \
196
+ with patch ('dropbox.Dropbox.sharing_create_shared_link' , side_effect = Exception ()), \
197
197
self .mock_config_info (self .config_info ):
198
198
self .verify_reply ('share boo' , bot_response )
199
199
0 commit comments