Skip to content

Commit 54369a7

Browse files
committed
fix tests
1 parent 77dcc63 commit 54369a7

File tree

13 files changed

+65
-54
lines changed

13 files changed

+65
-54
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
$(PYTHON) ./setup.py develop
1515

1616
dev:
17-
$(PIP) install flake8 nose coverage requests
17+
$(PIP) install -r requirements-dev.txt
1818
$(PYTHON) ./setup.py develop
1919

2020
install:

requirements-dev.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r requirements.txt
2+
nose
3+
flake8
4+
autopep8

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
mistune==0.7
2-
nose>=1.3

sdiff/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ def diff(md1, md2, renderer=TextRenderer()):
88
tree2 = parse(md2)
99

1010
tree1, tree2, struct_errors = diff_struct(tree1, tree2)
11-
tree1, tree2, links_errors = diff_links(tree1, tree2)
11+
# tree1, tree2, links_errors = diff_links(tree1, tree2)
1212

13-
errors = struct_errors + links_errors
13+
# errors = struct_errors + links_errors
14+
errors = struct_errors
1415

1516
return renderer.render(tree1), renderer.render(tree2), errors

setup.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
max-line-length = 120
3+
ignore = F403, F405
4+
5+
[pep8]
6+
max-line-length = 120

tests/fixtures/same/long.de.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
Bonjour,
1+
2+
3+
<table class="wrapper" width="476" align="center" style="margin: 0 auto 25px auto;;" cellpadding="2" cellspacing="0">
4+
<tr style="background-color: #eee; font-weight: bold;">
5+
<td class="holder" style="min-width:100px;">Appareils</td>
6+
<td class="holder" style="min-width:100px;">Statut</td>
7+
</tr>
8+
{{#devices}}
9+
<tr>
10+
<td class="text-01" style="min-width:100px;">{{name}}</td>
11+
<td class="text-01" style="min-width:100px; color:#92d58d">synchronisé</td>
12+
</tr>
13+
{{/devices}}
14+
</table>
15+
<sup>Un de vos appareils ne figure pas ici? Ouvrir KeepSafe sur le périphérique manquant avec la dernière version pour enregistrer l'état de la sauvegarde.</sup>
16+
17+
-----------
18+
19+
Vous aimez l'application KeepSafe? [Apprenez plus sur les bonnes fonctionnalités Premium de l'application KeepSafe](http://www.getkeepsafe.com/features.html).
220

3-
Bienvenue ! Vous venez d'activer votre compte KeepSafe et nous vous en remercions ! KeepSafe est l'environnement idéal pour stocker vos photos et vos vidéos les plus importantes et les plus personnelles. Nous avons créé cette application pour que personne ne tombe par accident sur votre contenu privé.
4-
5-
Voici quelques exemples sur la manière dont KeepSafe peut vous aider :
6-
7-
* Permet de garder à l'abri les photos importantes de vos proches
8-
* Permet de conserver une photo de votre permis de conduire et des documents/cartes important(e)s qui vous accompagnent partout.
9-
* Permet de ne pas mélanger votre vie personnelle et votre vie professionnelle
10-
* Permet de cacher des photos de surprises ou de cadeaux
11-
12-
KeepSafe entreposera toutes vos photos de manière sécurisée ! Ainsi, personne d'autre que vous ne pourra y accéder et vous ne transférerez pas par inadvertance votre contenu personnel sur des services ou des plateformes non souhaités.
13-
14-
KeepSafe vous permet d'accéder à vos photos sur plusieurs appareils (tels qu'une tablette).
15-
16-
Jetez un coup d’œil à notre FAQ pour en apprendre davantage :
17-
[http://support.getkeepsafe.com]()
18-
[Conditions du service ](https://www.getkeepsafe.com/privacy.html#terms), [Charte de confidentialité](http://getkeepsafe.com/privacy.html)
21+
Vous avez des questions à propos de KeepSafe? [Visitez notre base de connaissances](http://support.getkeepsafe.com/hc/).

tests/fixtures/same/long.en.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
Hello,
21

3-
Welcome to KeepSafe! You just activated your personal KeepSafe account successfully. KeepSafe is the best place to store all your personal and important photos and videos. We make sure that no one gets to see your important photos by accident.
42

5-
Some ideas for what you could use KeepSafe for as well:
3+
<table class="wrapper" width="476" align="center" style="margin: 0 auto 25px auto;;" cellpadding="2" cellspacing="0">
4+
<tr style="background-color: #eee; font-weight: bold;">
5+
<td class="holder" style="min-width:100px;">Devices</td>
6+
<td class="holder" style="min-width:100px;">Status</td>
7+
</tr>
8+
{{#devices}}
9+
<tr>
10+
<td class="text-01" style="min-width:100px;">{{name}}</td>
11+
<td class="text-01" style="min-width:100px; color:#92d58d">synced</td>
12+
</tr>
13+
{{/devices}}
14+
</table>
15+
<sup>Is one of your devices not listed above? Open KeepSafe on the device you would like to see above, and make sure you have the latest version of KeepSafe installed on that device.</sup>
616

7-
* Keep important pictures of people who are close to you
8-
* Store a photo of your drivers license and other important cards you carry with you
9-
* Separate work and life
10-
* Keep your pictures of surprises and gifts for others
17+
-----------
1118

12-
KeepSafe will store all your pictures securely and make sure that only you can access them and that they are not uploaded by accident to services where you don’t want to have them.
19+
Want to do even more with your KeepSafe? [Here are some tips and tricks for making the most out of your KeepSafe](http://www.getkeepsafe.com/features.html).
1320

14-
KeepSafe also allows you to view your pictures on multiple devices, like a tablet, at the same time.
15-
16-
Have a look at our FAQ and our terms, in case you want to learn a little more on how certain things are done:
17-
[http://support.getkeepsafe.com]()
18-
[Terms of Service](https://www.getkeepsafe.com/privacy.html#terms), [Privacy Policy](https://www.getkeepsafe.com/privacy.html)
21+
Questions? [Check out our knowledge base](http://support.getkeepsafe.com/hc/en-us/sections/200201364-FAQ).

tests/fixtures/trees.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
from sdiff.model import *
22

3+
34
def empty_tree():
45
return Root()
56

7+
68
def pt():
79
return Root([
810
Paragraph([
911
Text('dummy text')
1012
])
1113
])
1214

15+
1316
def r2t():
1417
return Root([
1518
Header(2, [
1619
Text('dummy text')
1720
])
1821
])
1922

23+
2024
def r4t():
2125
return Root([
2226
Header(4, [
2327
Text('dummy text')
2428
])
2529
])
2630

31+
2732
def lm2tm2t():
2833
return Root([
2934
List([
@@ -40,13 +45,15 @@ def lm2tm2t():
4045
])
4146
])
4247

48+
4349
def pa():
4450
return Root([
4551
Paragraph([
4652
Link('dummy link')
4753
])
4854
])
4955

56+
5057
def paa():
5158
return Root([
5259
Paragraph([
@@ -55,6 +62,7 @@ def paa():
5562
])
5663
])
5764

65+
5866
def ptat():
5967
return Root([
6068
Paragraph([
@@ -64,6 +72,7 @@ def ptat():
6472
])
6573
])
6674

75+
6776
def ptnt():
6877
return Root([
6978
Paragraph([
@@ -73,6 +82,7 @@ def ptnt():
7382
])
7483
])
7584

85+
7686
def pta2t():
7787
return Root([
7888
Paragraph([

tests/test_compare.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
from unittest import TestCase, skip
2-
from unittest.mock import MagicMock, patch
1+
from unittest import TestCase
32

43
from sdiff.compare import diff_links, diff_struct
5-
from sdiff.parser import parse
6-
from sdiff.errors import DeleteError, InsertError
74
from .fixtures import trees
85

96

tests/test_parser.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
from unittest import TestCase, skip
2-
from unittest.mock import MagicMock, patch
3-
4-
from sdiff import parser, tree_utils
5-
from sdiff.model import *
6-
7-
import re
1+
from unittest import TestCase
2+
from sdiff import parser
83

94

105
class TestParser(TestCase):

0 commit comments

Comments
 (0)