Ejemplo n.º 1
0
    def test_to_csv_to_stdout(self):
        table = Table(self.rows, self.columns)

        output = StringIO()
        table.to_csv(output)

        contents1 = output.getvalue()

        with open('examples/test.csv') as f:
            contents2 = f.read()

        self.assertEqual(contents1, contents2)
Ejemplo n.º 2
0
    def test_to_csv_to_stdout(self):
        table = Table(self.rows, self.columns)

        output = StringIO()
        table.to_csv(output)

        contents1 = output.getvalue()

        with open('examples/test.csv') as f:
            contents2 = f.read()

        self.assertEqual(contents1, contents2)
Ejemplo n.º 3
0
    def test_to_csv(self):
        table = Table(self.rows, self.columns)

        table.to_csv('.test.csv')

        with open('.test.csv') as f:
            contents1 = f.read()

        with open('examples/test.csv') as f:
            contents2 = f.read()

        self.assertEqual(contents1, contents2)

        os.remove('.test.csv')
Ejemplo n.º 4
0
    def test_to_csv(self):
        table = Table(self.rows, self.columns)

        table.to_csv('.test.csv')

        with open('.test.csv') as f:
            contents1 = f.read()

        with open('examples/test.csv') as f:
            contents2 = f.read()

        self.assertEqual(contents1, contents2)

        os.remove('.test.csv')
Ejemplo n.º 5
0
    def test_to_csv_file_like_object(self):
        table = Table(self.rows, self.columns)

        with open('.test.csv', 'w') as f:
            table.to_csv(f)

        with open('.test.csv') as f:
            contents1 = f.read()

        with open('examples/test.csv') as f:
            contents2 = f.read()

        self.assertEqual(contents1, contents2)

        os.remove('.test.csv')
Ejemplo n.º 6
0
    def test_to_csv_file_like_object(self):
        table = Table(self.rows, self.columns)

        with open('.test.csv', 'w') as f:
            table.to_csv(f)

        with open('.test.csv') as f:
            contents1 = f.read()

        with open('examples/test.csv') as f:
            contents2 = f.read()

        self.assertEqual(contents1, contents2)

        os.remove('.test.csv')