コード例 #1
0
    def test_functional(self):
        """
        Functional test for program

        """
        for i in range(1, 9):
            encode(r'test_res\in.bmp', r'test_res\file.jpg',
                   r'test_res\out file.bmp', i)
            decode(r'test_res\out file.bmp', r'test_res\decoded_file.jpg')
            self.assertEqual(
                read_bytearray_from_file(r'test_res\decoded_file.jpg'),
                read_bytearray_from_file(r'test_res\file.jpg')
            )
コード例 #2
0
ファイル: functional_tests.py プロジェクト: Gebon/BMP
    def test_functional(self):
        """
        Functional test for program

        """
        for i in range(1, 9):
            encode(get_path_to_resource('in.bmp'), get_path_to_resource('file.jpg'),
                   get_path_to_resource('out file.bmp'), i)
            decode(get_path_to_resource('out file.bmp'), get_path_to_resource('decoded_file.jpg'))
            self.assertEqual(
                read_bytearray_from_file(get_path_to_resource('decoded_file.jpg')),
                read_bytearray_from_file(get_path_to_resource('file.jpg'))
            )
コード例 #3
0
    def test_functional(self):
        """
        Functional test for program

        """
        for i in range(1, 9):
            encode(get_path_to_resource('in.bmp'),
                   get_path_to_resource('file.jpg'),
                   get_path_to_resource('out file.bmp'), i)
            decode(get_path_to_resource('out file.bmp'),
                   get_path_to_resource('decoded_file.jpg'))
            self.assertEqual(
                read_bytearray_from_file(
                    get_path_to_resource('decoded_file.jpg')),
                read_bytearray_from_file(get_path_to_resource('file.jpg')))
コード例 #4
0
"""
Main module for all program
"""
__author__ = 'Галлям'

from src.encoding import encode
from src.decoding import decode
from src.additional import create_argument_parser

parser = create_argument_parser()
args = parser.parse_args()

if not args.encode is None:
    encode(args.encode[0], args.encode[1], args.encode[2],
           args.bit_count)
elif not args.decode is None:
    decode(args.decode[0], args.decode[1])
else:
    print("This feature isn't implemented yet")