Skip to content

Commit 4adf841

Browse files
committed
fix tests
1 parent 4c265de commit 4adf841

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

mhi/main.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1097,10 +1097,14 @@ def cmd_main():
10971097
_cmd_dispatch(['mhi', cmd] + sys.argv[1:])
10981098

10991099

1100-
def main():
1100+
def init_config():
11011101
global config, state
11021102
cfgdir = os.environ.get('HOME', '')
11031103
config = ConfigObj(infile=f"{cfgdir}/.mhirc", create_empty=True)
11041104
state = ConfigObj(infile=f"{cfgdir}/.mhistate", create_empty=True)
1105+
1106+
1107+
def main():
1108+
init_config()
11051109
# main program
11061110
_cmd_dispatch(sys.argv)

tests/test_consolidate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from mhi import _consolidate
2+
from mhi.main import _consolidate
33

44
def test_flatten():
55
assert _consolidate([1,3,5,7,9]) == '1,3,5,7,9'

tests/test_fetch.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
import email
88
import imaplib
99

10-
import mhi
10+
from mhi import main as mhi
1111
#from click.testing import CliRunner # someday
12-
import six
1312

1413
from imap4mock import ImapConnectionMock
1514
imaplib.IMAP4_SSL = ImapConnectionMock()
1615

16+
mhi.init_config()
17+
1718
reference_mail = {
1819
'headers': {
1920
'From': 'exampleFrom <[email protected]>',

0 commit comments

Comments
 (0)