Beispiel #1
0
    def test_add_table_2(self):
        """Test adding new table at a specific index"""

        extcsv = Writer()
        extcsv.add_table('CONTENT', 'basic metadata, index 2', index=2)
        self.assertTrue('CONTENT$2' in extcsv.extcsv_ds.keys(),
                        'table not found')
    def test_add_table_2(self):
        """Test adding new table at a specific index"""

        extcsv = Writer()
        extcsv.add_table('CONTENT', 'basic metadata, index 2', index=2)
        self.assertTrue('CONTENT$2' in extcsv.extcsv_ds.keys(),
                        'table not found')
Beispiel #3
0
    def test_add_table_1(self):
        """Test adding new table"""

        extcsv = Writer()
        extcsv.add_table('CONTENT', 'basic metadata, index 1')
        self.assertTrue('CONTENT$1' in extcsv.extcsv_ds.keys(),
                        'table not found')
        self.assertEqual('basic metadata, index 1',
                         get_data(extcsv, 'CONTENT', 'comments')[0],
                         'invalid table comment')
    def test_add_table_1(self):
        """Test adding new table"""

        extcsv = Writer()
        extcsv.add_table('CONTENT', 'basic metadata, index 1')
        self.assertTrue('CONTENT$1' in extcsv.extcsv_ds.keys(),
                        'table not found')
        self.assertEqual('basic metadata, index 1',
                         get_data(extcsv, 'CONTENT', 'comments')[0],
                         'invalid table comment')
Beispiel #5
0
    def test_add_table_3(self):
        """Test order of tables to see if order of insert is preserved"""

        extcsv = Writer()
        extcsv.add_table('CONTENT', 'basic metadata, index 1')
        extcsv.add_table('CONTENT', 'basic metadata, index 2', index=2)
        extcsv.add_table('CONTENT', 'basic metadata, index 3', index=3)
        extcsv.add_table('CONTENT', 'basic metadata, index 4', index=4)
        self.assertTrue('CONTENT$1' in extcsv.extcsv_ds.keys(),
                        'table 1 not found')
        self.assertTrue('CONTENT$2' in extcsv.extcsv_ds.keys(),
                        'table 2 not found')
        self.assertTrue('CONTENT$3' in extcsv.extcsv_ds.keys(),
                        'table 3 not found')
        self.assertTrue('CONTENT$4' in extcsv.extcsv_ds.keys(),
                        'table 4 not found')
        self.assertEqual(0,
                         extcsv.extcsv_ds.keys().index('CONTENT$1'),
                         'table 1 index mismatch')
        self.assertEqual(1,
                         extcsv.extcsv_ds.keys().index('CONTENT$2'),
                         'table 2 index mismatch')
        self.assertEqual(2,
                         extcsv.extcsv_ds.keys().index('CONTENT$3'),
                         'table 3 index mismatch')
        self.assertEqual(3,
                         extcsv.extcsv_ds.keys().index('CONTENT$4'),
                         'table 4 index mismatch')
    def test_add_table_3(self):
        """Test order of tables to see if order of insert is preserved"""

        extcsv = Writer()
        extcsv.add_table('CONTENT', 'basic metadata, index 1')
        extcsv.add_table('CONTENT', 'basic metadata, index 2', index=2)
        extcsv.add_table('CONTENT', 'basic metadata, index 3', index=3)
        extcsv.add_table('CONTENT', 'basic metadata, index 4', index=4)
        self.assertTrue('CONTENT$1' in extcsv.extcsv_ds.keys(),
                        'table 1 not found')
        self.assertTrue('CONTENT$2' in extcsv.extcsv_ds.keys(),
                        'table 2 not found')
        self.assertTrue('CONTENT$3' in extcsv.extcsv_ds.keys(),
                        'table 3 not found')
        self.assertTrue('CONTENT$4' in extcsv.extcsv_ds.keys(),
                        'table 4 not found')
        self.assertEqual(0, extcsv.extcsv_ds.keys().index('CONTENT$1'),
                         'table 1 index mismatch')
        self.assertEqual(1, extcsv.extcsv_ds.keys().index('CONTENT$2'),
                         'table 2 index mismatch')
        self.assertEqual(2, extcsv.extcsv_ds.keys().index('CONTENT$3'),
                         'table 3 index mismatch')
        self.assertEqual(3, extcsv.extcsv_ds.keys().index('CONTENT$4'),
                         'table 4 index mismatch')