Simulate the echo program with print statement.
This commit is contained in:
parent
547bd75fd6
commit
8304658d4e
|
@ -13,7 +13,8 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""Archive commands for the echo program."""
|
"""Archive commands for the echo program, simulated by the Python print
|
||||||
|
statement."""
|
||||||
from patoolib import util
|
from patoolib import util
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,5 +47,6 @@ def list_rzip (archive, encoding, cmd, **kwargs):
|
||||||
return stripext(cmd, archive)
|
return stripext(cmd, archive)
|
||||||
|
|
||||||
def stripext (cmd, archive):
|
def stripext (cmd, archive):
|
||||||
"""Echo the name without suffix."""
|
"""Print the name without suffix."""
|
||||||
return [cmd, util.stripext(archive)]
|
print util.stripext(archive)
|
||||||
|
return None
|
||||||
|
|
|
@ -121,7 +121,6 @@ class TestArchives (ArchiveTest):
|
||||||
self.archive_test('t .bz2')
|
self.archive_test('t .bz2')
|
||||||
self.archive_create('t .bz2', singlefile=True)
|
self.archive_create('t .bz2', singlefile=True)
|
||||||
|
|
||||||
@needs_program('echo')
|
|
||||||
def test_echo (self):
|
def test_echo (self):
|
||||||
self.program = 'echo'
|
self.program = 'echo'
|
||||||
self.archive_list('t .bz2')
|
self.archive_list('t .bz2')
|
||||||
|
|
|
@ -137,7 +137,6 @@ class TestArchives (ArchiveTest):
|
||||||
self.archive_create('t.bz2.foo', format="bzip2", singlefile=True)
|
self.archive_create('t.bz2.foo', format="bzip2", singlefile=True)
|
||||||
|
|
||||||
@needs_program('file')
|
@needs_program('file')
|
||||||
@needs_program('echo')
|
|
||||||
def test_echo (self):
|
def test_echo (self):
|
||||||
self.program = 'echo'
|
self.program = 'echo'
|
||||||
self.archive_list('t.bz2.foo')
|
self.archive_list('t.bz2.foo')
|
||||||
|
|
Loading…
Reference in New Issue