Beispiel #1
0
    def test_table_options(self):
        """Test: src and dest table have different options"""
        self.src.tables['address'].options['engine'].value = "MyISAM"

        p,r = syncdb.sync_table_options(self.src.tables['address'], self.dest.tables['address'], sync_auto_inc=False, sync_comments=False)
        self.assertEqual(p, "ENGINE=MyISAM")
        self.assertEqual(r, "ENGINE=InnoDB")
Beispiel #2
0
    def test_table_options_with_comment(self):
        """Test: src and dest table have different options (include table COMMENT)"""
        self.src.tables['address'].options['engine'].value = "MyISAM"
        self.src.tables['address'].options['comment'].value =  "hello world"

        p,r = syncdb.sync_table_options(self.src.tables['address'], self.dest.tables['address'], sync_auto_inc=False, sync_comments=True)
        self.assertEqual(p, "ENGINE=MyISAM COMMENT='hello world'")
        self.assertEqual(r, "ENGINE=InnoDB COMMENT=''" )
Beispiel #3
0
    def test_table_options_with_auto_inc(self):
        """Test: src and dest table have different options (include AUTO_INCREMENT value)"""
        self.src.tables['address'].options['engine'].value = "MyISAM"
        self.src.tables['address'].options['auto_increment'].value = 11

        p,r = syncdb.sync_table_options(self.src.tables['address'], self.dest.tables['address'], sync_auto_inc=True, sync_comments=False)
        self.assertEqual(p, "ENGINE=MyISAM AUTO_INCREMENT=11")
        self.assertEqual(r, "ENGINE=InnoDB AUTO_INCREMENT=1")
Beispiel #4
0
    def test_table_options(self):
        """Test: src and dest table have different options"""
        self.src.tables['address'].options['engine'].value = "MyISAM"

        p, r = syncdb.sync_table_options(self.src.tables['address'],
                                         self.dest.tables['address'],
                                         sync_auto_inc=False,
                                         sync_comments=False)
        self.assertEqual(p, "ENGINE=MyISAM")
        self.assertEqual(r, "ENGINE=InnoDB")
Beispiel #5
0
    def test_table_options_with_auto_inc(self):
        """Test: src and dest table have different options (include AUTO_INCREMENT value)"""
        self.src.tables['address'].options['engine'].value = "MyISAM"
        self.src.tables['address'].options['auto_increment'].value = 11

        p, r = syncdb.sync_table_options(self.src.tables['address'],
                                         self.dest.tables['address'],
                                         sync_auto_inc=True,
                                         sync_comments=False)
        self.assertEqual(p, "ENGINE=MyISAM AUTO_INCREMENT=11")
        self.assertEqual(r, "ENGINE=InnoDB AUTO_INCREMENT=1")
Beispiel #6
0
    def test_table_options_with_comment(self):
        """Test: src and dest table have different options (include table COMMENT)"""
        self.src.tables['address'].options['engine'].value = "MyISAM"
        self.src.tables['address'].options['comment'].value = "hello world"

        p, r = syncdb.sync_table_options(self.src.tables['address'],
                                         self.dest.tables['address'],
                                         sync_auto_inc=False,
                                         sync_comments=True)
        self.assertEqual(p, "ENGINE=MyISAM COMMENT='hello world'")
        self.assertEqual(r, "ENGINE=InnoDB COMMENT=''")