Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"regex",
"sqlalchemy",
]
if not 'TRAVIS_CI' in os.environ:
if 'TRAVIS_CI' not in os.environ:
requirements.append('PySide')


setup(
name='everpad',
version=version,
Expand Down Expand Up @@ -93,8 +92,10 @@
]),
('share/locale/ru/LC_MESSAGES', ['i18n/ru/LC_MESSAGES/everpad.mo']),
('share/locale/ar/LC_MESSAGES', ['i18n/ar/LC_MESSAGES/everpad.mo']),
('share/locale/zh_CN/LC_MESSAGES', ['i18n/zh_CN/LC_MESSAGES/everpad.mo']),
('share/locale/zh_TW/LC_MESSAGES', ['i18n/zh_TW/LC_MESSAGES/everpad.mo']),
('share/locale/zh_CN/LC_MESSAGES',
['i18n/zh_CN/LC_MESSAGES/everpad.mo']),
('share/locale/zh_TW/LC_MESSAGES',
['i18n/zh_TW/LC_MESSAGES/everpad.mo']),
('share/locale/ja/LC_MESSAGES', ['i18n/ja/LC_MESSAGES/everpad.mo']),
('share/locale/es/LC_MESSAGES', ['i18n/es/LC_MESSAGES/everpad.mo']),
('share/locale/de/LC_MESSAGES', ['i18n/de/LC_MESSAGES/everpad.mo']),
Expand Down
9 changes: 5 additions & 4 deletions tests/pad/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def update(self, service):

app = FakeApp(sys.argv)


CONTENTS = [
u"<ul><li>23</li><li>567</li></ul>",
u"<p>123</p>\xa0\xa0ok",
Expand All @@ -50,12 +49,14 @@ def update(self, service):

SET_LINKS = [
(u"without", u"without"),
(u"https://github.com/nvbn/", u'<a href="https://github.com/nvbn/">https://github.com/nvbn/</a>'),
(u"https://github.com/nvbn/ http://ya.ru/", u'<a href="https://github.com/nvbn/">https://github.com/nvbn/</a> <a href="http://ya.ru/">http://ya.ru/</a>'),
(u"https://github.com/nvbn/",
u'<a href="https://github.com/nvbn/">https://github.com/nvbn/</a>'),
(u"https://github.com/nvbn/ http://ya.ru/",
u'<a href="https://github.com/nvbn/">https://github.com/nvbn/</a> <a '
u'href="http://ya.ru/">http://ya.ru/</a>'),
(u"<p>https://github.com/nvbn/</p>", u"<p>https://github.com/nvbn/</p>"),
]


if 'test_editor' in os.environ:
class EditorTestCase(unittest.TestCase):
def setUp(self):
Expand Down
22 changes: 10 additions & 12 deletions tests/provider/test_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from .. import settings

from dbus.exceptions import DBusException
from mock import MagicMock
from everpad.provider.service import ProviderService
Expand Down Expand Up @@ -77,15 +76,15 @@ def _create_notes(self):
]
self.notes = btype.Note.list << [
self.service.update_note(note) for note in notes
]
]

def _create_notebooks(self):
"""Create notebooks"""
self.notebook =\
self.notebook = \
btype.Notebook << self.service.create_notebook('test', None)
self.notebook2 =\
self.notebook2 = \
btype.Notebook << self.service.create_notebook('test2', None)
self.notebook3 =\
self.notebook3 = \
btype.Notebook << self.service.create_notebook(u'Блокнот', None)

def _create_service(self):
Expand Down Expand Up @@ -432,9 +431,8 @@ def test_get_note_resources(self):
)
self.session.commit()

resources_btype = btype.Resource.list << self.service.get_note_resources(
note.id,
)
resources_btype = btype.Resource.list << \
self.service.get_note_resources(note.id,)

self.assertEqual(resources_btype[0].file_name, resource.file_name)

Expand Down Expand Up @@ -463,7 +461,7 @@ def test_delete_note(self):

def test_create_notebook(self):
"""Test create notebook"""
notebook_btype =\
notebook_btype = \
btype.Notebook << self.service.create_notebook('test', 'test')

notebook = self.session.query(models.Notebook).filter(
Expand All @@ -474,15 +472,15 @@ def test_create_notebook(self):
def test_authenticate(self):
"""Test authenticate"""
self.service.authenticate('test')
self.service.qobject\
self.service.qobject \
.remove_authenticate_signal.emit.assert_called_once_with()
self.service.qobject\
self.service.qobject \
.authenticate_signal.emit.assert_called_once_with('test')

def test_remove_authentication(self):
"""Test remove authentication"""
self.service.remove_authentication()
self.service.qobject\
self.service.qobject \
.remove_authenticate_signal.emit.assert_called_once_with()

def test_list_places(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/settings/ci_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
CONSUMER_KEY = 'nvbn-1422'
CONSUMER_SECRET = 'c17c0979d0054310'
DB_PATH = ':memory:'
TOKEN = 'S=s1:U=6604d:E=145758f3852:C=13e1dde0c54:P=1cd:A=en-devtoken:V=2:H=d2b720cdb06c99a105f937e669ebfc67'
TOKEN = 'S=s1:U=6604d:E=145758f3852:C=13e1dde0c54:P=1cd:A=en-devtoken:V=2:H' \
'=d2b720cdb06c99a105f937e669ebfc67'
4 changes: 4 additions & 0 deletions tests/test_basetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Fake(DbusSendable):
('id', 'i'),
('name', 's'),
)

self.assertEqual(
Fake.signature, '(is)',
'generate signature',
Expand All @@ -18,6 +19,7 @@ def test_serialise(self):
class Fake(object):
id = 0
name = '123'

tag = Tag.from_obj(Fake())
self.assertEqual(
tag.struct, (0, '123'),
Expand All @@ -34,13 +36,15 @@ def test_load(self):
def test_give(self):
class Fake(object):
id = 0

@property
def id_dbus(self):
return self.id

@id_dbus.setter
def id_dbus(self, val):
self.id = val + 12

tag = Tag.from_tuple((0, '123'))
obj = Fake()
tag.give_to_obj(obj)
Expand Down