Пример #1
0
 def test_mixed_nesting(self):
     self.assertTrue(is_sql_equal('SELECT 1', ['SELECT 1']))
     self.assertFalse(is_sql_equal('SELECT 1', [('SELECT %s', [1])]))
Пример #2
0
 def test_mixed_with_params(self):
     self.assertFalse(is_sql_equal([('SELECT %s', [1]), ('SELECT %s', [2])],
                                   ['SELECT 1', ('SELECT %s', [2])]))
     self.assertFalse(is_sql_equal(['SELECT 1', ('SELECT %s', [2])],
                                   ['SELECT 1', ('SELECT %s', [3])]))
Пример #3
0
 def test_nested(self):
     self.assertTrue(is_sql_equal(['SELECT 1', 'SELECT 2'], ['SELECT 1', 'SELECT 2']))
     self.assertFalse(is_sql_equal(['SELECT 1', 'SELECT 2'], ['SELECT 1', 'SELECT 3']))
Пример #4
0
 def test_nested_with_params(self):
     self.assertTrue(is_sql_equal([('SELECT %s', [1]), ('SELECT %s', [2])],
                                  [('SELECT %s', [1]), ('SELECT %s', [2])]))
     self.assertFalse(is_sql_equal([('SELECT %s', [1]), ('SELECT %s', [2])],
                                   [('SELECT %s', [1]), ('SELECT %s', [3])]))
Пример #5
0
 def test_flat(self):
     self.assertTrue(is_sql_equal('SELECT 1', 'SELECT 1'))
     self.assertFalse(is_sql_equal('SELECT 1', 'SELECT 2'))