-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
157 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.py text eol=lf | ||
*.rst text eol=lf | ||
*.ttf binary | ||
LICEN[CS]E text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00001111111000110011111110000 | ||
00001000001001111010000010000 | ||
00001011101011010010111010000 | ||
00001011101011011010111010000 | ||
00001011101000101010111010000 | ||
00001000001001001010000010000 | ||
00001111111010101011111110000 | ||
00000000000001100000000000000 | ||
00000001101101111000011000000 | ||
00001100110111001110110100000 | ||
00001101101100111101011100000 | ||
00001011010100010100101100000 | ||
00000110111001100001110000000 | ||
00000000000011001000010110000 | ||
00001111111011100011101000000 | ||
00001000001001110000011000000 | ||
00001011101011101001010110000 | ||
00001011101010110011000000000 | ||
00001011101000010000111110000 | ||
00001000001000101101011110000 | ||
00001111111000100010100000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00001111111010111011111110000 | ||
00001000001011111010000010000 | ||
00001011101011011010111010000 | ||
00001011101001101010111010000 | ||
00001011101001010010111010000 | ||
00001000001010000010000010000 | ||
00001111111010101011111110000 | ||
00000000000010100000000000000 | ||
00000011101010010111001110000 | ||
00000111100111000011001000000 | ||
00001101001101011001010110000 | ||
00001101100100011011100100000 | ||
00001111111101000001010110000 | ||
00000000000010001100110000000 | ||
00001111111000110010001100000 | ||
00001000001001111110011110000 | ||
00001011101011010000000100000 | ||
00001011101010100011110000000 | ||
00001011101011101000001000000 | ||
00001000001000000111011000000 | ||
00001111111000011100100100000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 | ||
00000000000000000000000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2016 - 2020 -- Lars Heuer | ||
# All rights reserved. | ||
# | ||
# License: BSD License | ||
# | ||
"""\ | ||
Tests against issue #84. | ||
<https://github.com/heuer/segno/issues/84> | ||
""" | ||
from __future__ import unicode_literals, absolute_import | ||
import os | ||
import tempfile | ||
from segno import cli | ||
import pytest | ||
|
||
|
||
def test_issue_84_default_encoding(): | ||
with open(os.path.join(os.path.dirname(__file__), 'issue-84', 'issue-84-iso-8859-1.txt'), 'r') as f: | ||
expected = f.read() | ||
f = tempfile.NamedTemporaryFile('w', suffix='.txt', delete=False) | ||
f.close() | ||
try: | ||
cli.main(['-o', f.name, 'Müller']) | ||
with open(f.name, 'r') as f: | ||
result = f.read() | ||
assert expected == result | ||
# Explicit but default encoding | ||
cli.main(['-o', f.name, '--encoding', 'iso-8859-1', 'Müller']) | ||
with open(f.name, 'r') as f: | ||
result = f.read() | ||
assert expected == result | ||
# Explicit but default encoding | ||
cli.main(['-o', f.name, '--encoding', 'latin1', 'Müller']) | ||
with open(f.name, 'r') as f: | ||
result = f.read() | ||
assert expected == result | ||
finally: | ||
os.unlink(f.name) | ||
|
||
|
||
def test_issue_84_utf8(): | ||
with open(os.path.join(os.path.dirname(__file__), 'issue-84', 'issue-84-utf-8.txt'), 'r') as f: | ||
expected = f.read() | ||
f = tempfile.NamedTemporaryFile('w', suffix='.txt', delete=False) | ||
f.close() | ||
try: | ||
cli.main(['-o', f.name, '--encoding', 'utf-8', 'Müller']) | ||
with open(f.name, 'r') as f: | ||
result = f.read() | ||
assert expected == result | ||
cli.main(['-o', f.name, '--encoding', 'UTf-8', 'Müller']) | ||
with open(f.name, 'r') as f: | ||
result = f.read() | ||
assert expected == result | ||
finally: | ||
os.unlink(f.name) | ||
|
||
|
||
if __name__ == '__main__': | ||
pytest.main([__file__]) |