Exemplo n.º 1
0
 def test_get_table_names_for_mysql(self, sb_output):
     sb_output.return_value = "Tables_in_test\ntable1\ntable2\ntable3"
     table_list = sut.get_table_names("mysql -u root test")
     self.assertEqual(table_list, [{
         "word": "table1"
     }, {
         "word": "table2"
     }, {
         "word": "table3"
     }])
Exemplo n.º 2
0
 def test_get_table_names_for_psql(self, sb_output):
     sb_output.return_value = " tablename\n----------\n table1\n table2\n table3\n(3 rows)"
     table_list = sut.get_table_names("psql -U Jrock test")
     self.assertEqual(table_list, [{
         "word": "table1"
     }, {
         "word": "table2"
     }, {
         "word": "table3"
     }])
Exemplo n.º 3
0
 def test_get_table_names_for_oracle(self, sb_output):
     sb_output.return_value = "Tables_in_test\ntable1\ntable2\ntable3"
     table_list = sut.get_table_names(
         "sqlplus64 test/12345678:192.168.0.1:1251/orcl")
     self.assertEqual(table_list, [{
         "word": "table1"
     }, {
         "word": "table2"
     }, {
         "word": "table3"
     }])
 def test_get_table_names_for_psql(self, sb_output):
     sb_output.return_value = " tablename\n----------\n table1\n table2\n table3\n(3 rows)"
     table_list = sut.get_table_names("psql -U Jrock test")
     self.assertEqual(table_list, [{"word": "table1"}, {"word": "table2"}, {"word": "table3"}])
 def test_get_table_names_for_mysql(self, sb_output):
     sb_output.return_value = "Tables_in_test\ntable1\ntable2\ntable3"
     table_list = sut.get_table_names("mysql -u root test")
     self.assertEqual(table_list, [{"word": "table1"}, {"word": "table2"}, {"word": "table3"}])