def test_list_files(self, mock_requests): try: mock_requests.get.side_effect = Timeout with self.assertRaises(Timeout): list_files(BUCKET) mock_requests.get.assert_called_once() except Exception as e: print(e)
def save_feed(): if request.method == 'POST': correct_label = str(request.form.get('comp_select')) feedfile = open("flask-drive/feed/user.csv", "a") with feedfile: writer = csv.writer(feedfile) writer.writerow(correct_label) contents = list_files("flaskdrive") return render_template('storage.html', msg="Feedback send! Retry it!", contents=contents)
def storage(): contents = list_files("flaskdrive") return render_template('storage.html', contents=contents)
def storage(): contents = list_files(BUCKET) return render_template('storage.html', contents=contents)
def test_list_files(self): contents= [] contents= list_files(MY_BUCKET) 'return contents' for i in contents: print (i)
def storage(): contents = list_files("rahulb-test-bucket") return render_template('storage.html', contents=contents)