Exemplo n.º 1
0
 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')
     ])
Exemplo n.º 2
0
 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')
     ])
Exemplo n.º 3
0
 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')
     ])
Exemplo n.º 4
0
 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')
Exemplo n.º 5
0
 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')])
Exemplo n.º 6
0
 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')])
Exemplo n.º 7
0
 def test_it_executes_the_migration_script(self):
     CQLExecutor.execute(self.session, 'script')
     self.session.execute.assert_called_once_with('script')
Exemplo n.º 8
0
 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')
Exemplo n.º 9
0
 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')]
     )
Exemplo n.º 10
0
 def test_it_executes_the_migration_script(self):
     CQLExecutor.execute(self.session, 'script')
     self.session.execute.assert_called_once_with('script')