"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/t50_methods.py" between
recode-3.7.4.tar.gz and recode-3.7.5.tar.gz

About: recode is a charset converter tool and library (fork of the original and now unmaintained GNU recode).

t50_methods.py  (recode-3.7.4):t50_methods.py  (recode-3.7.5)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import common import common
from common import setup_module, teardown_module from common import setup_module, teardown_module
from __main__ import py from __main__ import py
import os, sys import os, sys
input_name = '%s/../COPYING' % os.path.dirname(sys.argv[0]) input_name = '%s/../COPYING' % os.path.dirname(sys.argv[0])
input = file(input_name, 'rb').read() with open(input_name) as f:
input = f.read()
def test_1(): def test_1():
# No step at all. # No step at all.
yield validate, 'texte..texte' yield validate, 'texte..texte'
# One single step. # One single step.
yield validate, 'latin1..ibmpc/' yield validate, 'latin1..ibmpc/'
# One single step and a surface # One single step and a surface
yield validate, 'latin1..ibmpc' yield validate, 'latin1..ibmpc'
skipping to change at line 44 skipping to change at line 45
def validate(request): def validate(request):
before, after = request.split('..') before, after = request.split('..')
# With a pipe # With a pipe
if os.name == 'nt': if os.name == 'nt':
py.test.skip() py.test.skip()
command = ('$R --quiet --force < %s %s' command = ('$R --quiet --force < %s %s'
'| $R --quiet --force %s..%s' '| $R --quiet --force %s..%s'
% (input_name, request, after, before)) % (input_name, request, after, before))
print command print(command)
output = common.external_output(command) output = common.external_output(command)
common.assert_or_diff(output, input) common.assert_or_diff(output, input)
# With an intermediate file # With an intermediate file
file(common.run.work, 'wb').write(input) with open(common.run.work, 'w') as f:
command1 = ('$R --quiet --force %s %s' command1 = ('$R --quiet --force %s %s'
% (request, common.run.work)) % (request, common.run.work))
command2 = ('$R --quiet --force %s..%s %s' command2 = ('$R --quiet --force %s..%s %s'
% (after, before, common.run.work)) % (after, before, common.run.work))
print command1 print(command1)
print command2 print(command2)
common.external_output(command1) common.external_output(command1)
common.external_output(command2) common.external_output(command2)
output = file(common.run.work, 'rb').read() with open(common.run.work) as f:
output = f.read()
common.assert_or_diff(output, input) common.assert_or_diff(output, input)
 End of changes. 5 change blocks. 
6 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)