<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> import unittest <EOL> import phlgitu_fixture <EOL> import abdt_differ <EOL> import abdt_exception <EOL> class Test ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def tearDown ( self ) : <EOL> pass <EOL> def test_A_Breathing ( self ) : <EOL> with phlgitu_fixture . lone_worker_context ( ) as worker : <EOL> worker . commit_new_file_on_new_branch ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def make_diff ( max_bytes ) : <EOL> return abdt_differ . make_raw_diff ( <EOL> worker . repo , "<STR_LIT>" , "<STR_LIT>" , max_bytes ) <EOL> diff_result = make_diff ( <NUM_LIT:1000> ) <EOL> self . assertIn ( "<STR_LIT>" , diff_result . diff ) <EOL> with self . assertRaises ( abdt_exception . LargeDiffException ) : <EOL> make_diff ( <NUM_LIT:1> ) <EOL> def test_B_ReduceSmallChangeOnLargeFile ( self ) : <EOL> with phlgitu_fixture . lone_worker_context ( ) as worker : <EOL> large_content = "<STR_LIT>" * <NUM_LIT:1000> <EOL> worker . commit_new_file ( <EOL> "<STR_LIT>" , "<STR_LIT>" , large_content ) <EOL> worker . append_to_file_on_new_branch ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def make_diff ( max_bytes ) : <EOL> return abdt_differ . make_raw_diff ( <EOL> worker . repo , "<STR_LIT>" , "<STR_LIT>" , max_bytes ) <EOL> diff_result = make_diff ( <NUM_LIT> ) <EOL> self . assertIn ( "<STR_LIT>" , diff_result . diff ) <EOL> original_diff_size = len ( diff_result . diff ) <EOL> diff_result = make_diff ( <NUM_LIT> ) <EOL> self . assertIn ( "<STR_LIT>" , diff_result . diff ) <EOL> reduced_context_diff_size = len ( diff_result . diff ) <EOL> self . assertTrue ( <EOL> any ( <EOL> isinstance ( r , abdt_differ . LessContextReduction ) <EOL> for r in diff_result . reduction_list ) ) <EOL> self . assertLess ( <EOL> reduced_context_diff_size , <EOL> original_diff_size ) <EOL> diff_result = make_diff ( <NUM_LIT> ) <EOL> self . assertIn ( "<STR_LIT>" , diff_result . diff ) <EOL> no_context_diff_size = len ( diff_result . diff ) <EOL> self . assertTrue ( <EOL> any ( <EOL> isinstance ( r , abdt_differ . RemoveContextReduction ) <EOL> for r in diff_result . reduction_list ) ) <EOL> self . assertLess ( <EOL> no_context_diff_size , <EOL> reduced_context_diff_size ) <EOL> def test_C_ReduceAddMassiveFile ( self ) : <EOL> with phlgitu_fixture . lone_worker_context ( ) as worker : <EOL> large_content = "<STR_LIT>" * <NUM_LIT:1000> <EOL> worker . commit_new_file_on_new_branch ( <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , large_content ) <EOL> def make_diff ( max_bytes ) : <EOL> return abdt_differ . make_raw_diff ( <EOL> worker . repo , "<STR_LIT>" , "<STR_LIT>" , max_bytes ) <EOL> diff_result = make_diff ( <NUM_LIT> ) <EOL> self . assertIn ( "<STR_LIT>" , diff_result . diff ) <EOL> original_diff_size = len ( diff_result . diff ) <EOL> diff_result = make_diff ( <NUM_LIT> ) <EOL> self . assertNotIn ( "<STR_LIT>" , diff_result . diff ) <EOL> diffstat_diff_size = len ( diff_result . diff ) <EOL> self . assertTrue ( <EOL> any ( <EOL> isinstance ( r , abdt_differ . DiffStatReduction ) <EOL> for r in diff_result . reduction_list ) ) <EOL> self . assertLess ( <EOL> diffstat_diff_size , <EOL> original_diff_size ) </s>
