<s> """<STR_LIT>""" <EOL> from unittest import TestCase <EOL> from nose . tools import eq_ <EOL> from . . transform import split_statements <EOL> from . . transform import remove_comments <EOL> from . . transform import remove_empty_statements <EOL> from . . transform import remove_transactional <EOL> from . . transform import remove_newlines <EOL> class TestRemoveEmptyStatements ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def test_basic ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( data ) , result ) <EOL> @ staticmethod <EOL> def test_multiple_statements_single_duplication ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( data ) , result ) <EOL> @ staticmethod <EOL> def test_multiple_statements_multiple_duplication ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( data ) , result ) <EOL> @ staticmethod <EOL> def test_start_empty ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( data ) , result ) <EOL> class TestRemoveNewLines ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def test_basic ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_newlines ( data ) , result ) <EOL> @ staticmethod <EOL> def test_advanced ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_newlines ( data ) , result ) <EOL> @ staticmethod <EOL> def test_quoted_newlines ( ) : <EOL> """<STR_LIT>""" <EOL> data = "<STR_LIT>" <EOL> result = "<STR_LIT>" <EOL> eq_ ( remove_newlines ( data ) , result ) <EOL> class TestRemoveComments ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def test_multiline_comment ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_comments ( data ) , result ) <EOL> @ staticmethod <EOL> def test_singleline_comment_basic ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_comments ( data ) , result ) <EOL> @ staticmethod <EOL> def test_singleline_comment_advanced ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_comments ( data ) , result ) <EOL> @ staticmethod <EOL> def test_singleline_multiline_comment ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_comments ( data ) , result ) <EOL> class TestRemoveTransactional ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def test_remove_none ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_transactional ( data ) , result ) <EOL> @ staticmethod <EOL> def test_remove_begin ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( remove_transactional ( data ) ) , result ) <EOL> @ staticmethod <EOL> def test_remove_commit ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( remove_transactional ( data ) ) , result ) <EOL> @ staticmethod <EOL> def test_remove_begin_commit ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( remove_transactional ( data ) ) , result ) <EOL> @ staticmethod <EOL> def test_just_begin_commit ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> eq_ ( remove_empty_statements ( remove_transactional ( data ) ) , result ) <EOL> class TestSplitOmitQuoted ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ staticmethod <EOL> def test_basic ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = [ '<STR_LIT:a>' , '<STR_LIT>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> eq_ ( split_statements ( data ) , result ) <EOL> @ staticmethod <EOL> def test_newline_sql ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = [ '<STR_LIT:a>' , '<STR_LIT>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> eq_ ( split_statements ( data ) , result ) <EOL> @ staticmethod <EOL> def test_paran_sql ( ) : <EOL> """<STR_LIT>""" <EOL> data = '<STR_LIT>' <EOL> result = [ '<STR_LIT:a>' , '<STR_LIT>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> eq_ ( split_statements ( data ) , result ) <EOL> @ staticmethod <EOL> def test_multiple_sql ( ) : <EOL> """<STR_LIT>""" <EOL> data = """<STR_LIT>""" <EOL> result = [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> eq_ ( split_statements ( remove_empty_statements ( <EOL> remove_comments ( data ) ) ) , result ) <EOL> @ staticmethod <EOL> def test_split_escaped_sql ( ) : <EOL> """<STR_LIT>""" <EOL> data = "<STR_LIT>" <EOL> result = [ '<STR_LIT:a>' , "<STR_LIT>" , '<STR_LIT:c>' ] <EOL> eq_ ( split_statements ( data ) , result ) </s>
