summary refs log tree commit diff stats
path: root/lib/dirstore.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-01-19 00:59:20 +0100
committerDrew DeVault <sir@cmpwn.com>2020-01-18 19:00:02 -0500
commit472c421e85fafbd2905e785852d04a7c0ab1e60a (patch)
tree85064ee861b731bdc80daccb75abe926fff9108d /lib/dirstore.go
parent686ca244052389b7815f7f2d73391e5f4c2b1ad7 (diff)
downloadaerc-472c421e85fafbd2905e785852d04a7c0ab1e60a.tar.gz
worker/imap: don't decode in FetchFullMessage.
Doing that breaks `git am` as it expected the encoded variant.
Same is probably true for any sort of signature validation (gpg / dkim)
Diffstat (limited to 'lib/dirstore.go')
0 files changed, 0 insertions, 0 deletions
/a> 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75



















                                                                       









                                                         


























                                                                            













                                                                                  



                          
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

if __name__ == '__main__': from __init__ import init; init()

import unittest
import os
from os.path import realpath, join, dirname

from test import Fake
from ranger.shared import FileManagerAware, SettingsAware
from ranger.core.loader import Loader
from ranger.fsobject import Directory, File
from ranger.ext.openstruct import OpenStruct

TESTDIR = realpath(join(dirname(__file__), 'testdir'))
#TESTDIR = "/usr/sbin"

class Test1(unittest.TestCase):
	def test_loader(self):
		loader = Loader()
		fm = OpenStruct(loader=loader)
		SettingsAware.settings = Fake()
		FileManagerAware.fm = fm

		# initially, the loader has nothing to do
		self.assertFalse(loader.has_work())

		dir = Directory(TESTDIR)
		self.assertEqual(None, dir.files)
		self.assertFalse(loader.has_work())

		# Calling load_content() will enqueue the loading operation.
		# dir is not loaded yet, but the loader has work
		dir.load_content(schedule=True)
		self.assertEqual(None, dir.files)
		self.assertTrue(loader.has_work())

		iterations = 0
		while loader.has_work():
			iterations += 1
			loader.work()
		#print(iterations)
		self.assertNotEqual(None, dir.files)
		self.assertFalse(loader.has_work())
#
#	def test_get_overhead_of_loader(self):
#		N = 5
#		tloader = benchmark_load(N)
#		traw = benchmark_raw_load(N)
#		#traw1k = 250.0
#		#traw = traw1k * N / 1000.0
#		#print("Loader: {0}s".format(tloader))
#		#print("Raw:    {0}s".format(traw))
#		self.assertTrue(tloader > traw)
#		overhead = tloader * 100 / traw - 100
#		self.assertTrue(overhead < 2, "overhead of loader too high: {0}" \
#				.format(overhead))
#		#print("Overhead: {0:.5}%".format(overhead))


if __name__ == '__main__':
	unittest.main()