mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
fix some lint issues, and run it during circle-CI
This commit is contained in:
@@ -37,7 +37,7 @@ if [ -n "$TESTS" ]; then
|
|||||||
export PYTHONDONTWRITEBYTECODE=1
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
# run tox
|
# run tox
|
||||||
tox --workdir "$TOXWORKDIR" -e py27,py35,py36,py37,auditwheels
|
tox --workdir "$TOXWORKDIR" -e lint,py27,py35,py36,py37,auditwheels
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from deltachat import capi, const
|
|||||||
from deltachat.capi import ffi
|
from deltachat.capi import ffi
|
||||||
from deltachat.account import Account # noqa
|
from deltachat.account import Account # noqa
|
||||||
|
|
||||||
__version__ = "0.10.0.dev2"
|
__version__ = "0.10.0.dev3"
|
||||||
|
|
||||||
|
|
||||||
_DC_CALLBACK_MAP = {}
|
_DC_CALLBACK_MAP = {}
|
||||||
|
|||||||
@@ -285,14 +285,14 @@ class Account(object):
|
|||||||
"""return after all delta chat state is exported to a new file in
|
"""return after all delta chat state is exported to a new file in
|
||||||
the specified directory.
|
the specified directory.
|
||||||
"""
|
"""
|
||||||
l = os.listdir(backupdir)
|
snap_files = os.listdir(backupdir)
|
||||||
self._imex_completed.clear()
|
self._imex_completed.clear()
|
||||||
lib.dc_imex(self._dc_context, 11, as_dc_charpointer(backupdir), ffi.NULL)
|
lib.dc_imex(self._dc_context, 11, as_dc_charpointer(backupdir), ffi.NULL)
|
||||||
if not self._threads.is_started():
|
if not self._threads.is_started():
|
||||||
lib.dc_perform_imap_jobs(self._dc_context)
|
lib.dc_perform_imap_jobs(self._dc_context)
|
||||||
self._imex_completed.wait()
|
self._imex_completed.wait()
|
||||||
for x in os.listdir(backupdir):
|
for x in os.listdir(backupdir):
|
||||||
if x not in l:
|
if x not in snap_files:
|
||||||
return os.path.join(backupdir, x)
|
return os.path.join(backupdir, x)
|
||||||
|
|
||||||
def import_from_file(self, path):
|
def import_from_file(self, path):
|
||||||
@@ -370,14 +370,14 @@ class IOThreads:
|
|||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
def imap_thread_run(self):
|
def imap_thread_run(self):
|
||||||
print ("starting imap thread")
|
print("starting imap thread")
|
||||||
while not self._thread_quitflag:
|
while not self._thread_quitflag:
|
||||||
lib.dc_perform_imap_jobs(self._dc_context)
|
lib.dc_perform_imap_jobs(self._dc_context)
|
||||||
lib.dc_perform_imap_fetch(self._dc_context)
|
lib.dc_perform_imap_fetch(self._dc_context)
|
||||||
lib.dc_perform_imap_idle(self._dc_context)
|
lib.dc_perform_imap_idle(self._dc_context)
|
||||||
|
|
||||||
def smtp_thread_run(self):
|
def smtp_thread_run(self):
|
||||||
print ("starting smtp thread")
|
print("starting smtp thread")
|
||||||
while not self._thread_quitflag:
|
while not self._thread_quitflag:
|
||||||
lib.dc_perform_smtp_jobs(self._dc_context)
|
lib.dc_perform_smtp_jobs(self._dc_context)
|
||||||
lib.dc_perform_smtp_idle(self._dc_context)
|
lib.dc_perform_smtp_idle(self._dc_context)
|
||||||
|
|||||||
@@ -234,9 +234,9 @@ class TestOfflineAccount:
|
|||||||
assert os.path.exists(path)
|
assert os.path.exists(path)
|
||||||
ac2 = acfactory.get_unconfigured_account()
|
ac2 = acfactory.get_unconfigured_account()
|
||||||
ac2.import_from_file(path)
|
ac2.import_from_file(path)
|
||||||
l = ac2.get_contacts(query="some1")
|
contacts = ac2.get_contacts(query="some1")
|
||||||
assert len(l) == 1
|
assert len(contacts) == 1
|
||||||
contact2 = l[0]
|
contact2 = contacts[0]
|
||||||
assert contact2.addr == "some1@hello.com"
|
assert contact2.addr == "some1@hello.com"
|
||||||
chat2 = ac2.create_chat_by_contact(contact2)
|
chat2 = ac2.create_chat_by_contact(contact2)
|
||||||
messages = chat2.get_messages()
|
messages = chat2.get_messages()
|
||||||
@@ -270,9 +270,9 @@ class TestOnlineAccount:
|
|||||||
c2 = ac1.create_contact(email=ac2.get_config("addr"))
|
c2 = ac1.create_contact(email=ac2.get_config("addr"))
|
||||||
chat = ac1.create_chat_by_contact(c2)
|
chat = ac1.create_chat_by_contact(c2)
|
||||||
assert chat.id >= const.DC_CHAT_ID_LAST_SPECIAL
|
assert chat.id >= const.DC_CHAT_ID_LAST_SPECIAL
|
||||||
#wait_successful_IMAP_SMTP_connection(ac1)
|
wait_successful_IMAP_SMTP_connection(ac1)
|
||||||
wait_configuration_progress(ac1, 1000)
|
wait_configuration_progress(ac1, 1000)
|
||||||
#wait_successful_IMAP_SMTP_connection(ac2)
|
wait_successful_IMAP_SMTP_connection(ac2)
|
||||||
wait_configuration_progress(ac2, 1000)
|
wait_configuration_progress(ac2, 1000)
|
||||||
|
|
||||||
msg_out = chat.send_text("message1")
|
msg_out = chat.send_text("message1")
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ commands =
|
|||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
basepython = python2.7
|
basepython = python3.5
|
||||||
deps =
|
deps =
|
||||||
flake8
|
flake8
|
||||||
# pygments required by rst-lint
|
# pygments required by rst-lint
|
||||||
|
|||||||
Reference in New Issue
Block a user