def test_it_multi_line_statements(self): CQLExecutor.execute( self.session, 'statement start\nmore statement\nend statement;\nstatement\n2') self.session.execute.assert_has_calls([ mock.call('statement start more statement end statement'), mock.call('statement 2') ])
def test_it_ignores_comments(self): CQLExecutor.execute( self.session, 'line1;\n--comment\n//comment\n\t//comment\nline2' ) self.session.execute.assert_has_calls([ mock.call('line1'), mock.call('line2') ])
def test_it_multi_line_statements(self): CQLExecutor.execute( self.session, 'statement start\nmore statement\nend statement;\nstatement\n2' ) self.session.execute.assert_has_calls([ mock.call('statement start more statement end statement'), mock.call('statement 2') ])
def test_it_does_not_run_the_undo_section(self): CQLExecutor.execute(self.session, 'migration statement;\n--//@UNDO\nundo statement') self.session.execute.assert_called_once_with('migration statement')
def test_it_ignores_comments(self): CQLExecutor.execute( self.session, 'line1;\n--comment\n//comment\n\t//comment\nline2') self.session.execute.assert_has_calls( [mock.call('line1'), mock.call('line2')])
def test_it_executes_a_multi_line_migration_script(self): CQLExecutor.execute(self.session, 'line1;\nline2;\n') self.session.execute.assert_has_calls( [mock.call('line1'), mock.call('line2')])
def test_it_executes_the_migration_script(self): CQLExecutor.execute(self.session, 'script') self.session.execute.assert_called_once_with('script')
def test_it_does_not_run_the_undo_section(self): CQLExecutor.execute( self.session, 'migration statement;\n--//@UNDO\nundo statement' ) self.session.execute.assert_called_once_with('migration statement')
def test_it_executes_a_multi_line_migration_script(self): CQLExecutor.execute(self.session, 'line1;\nline2;\n') self.session.execute.assert_has_calls( [mock.call('line1'), mock.call('line2')] )