Beispiel #1
0
 def test_missing_format(self):
     self.assertEqual(('foo.xlsx', 'xlsx-multiple'),
                      Client.ensure_format_ext('foo', None))
     self.assertEqual(('foo.txt.xlsx', 'xlsx-multiple'),
                      Client.ensure_format_ext('foo.txt', None))
     self.assertEqual(('foo.xlsx', 'xlsx-multiple'),
                      Client.ensure_format_ext('foo.xlsx', None))
Beispiel #2
0
 def test_unmodified(self):
     self.assertEqual(('foo.csv', 'csv'),
                      Client.ensure_format_ext('foo.csv', 'csv'))
     self.assertEqual(('foo.xlsx', 'xlsx-multiple'),
                      Client.ensure_format_ext('foo.xlsx', 'xlsx-multiple'))
     self.assertEqual(('foo.xlsx', 'xlsx-multiple'),
                      Client.ensure_format_ext('foo.xlsx', 'xlsx-multiple'))
     self.assertEqual(('foo.xml', 'xml'),
                      Client.ensure_format_ext('foo.xml', 'xml'))
Beispiel #3
0
 def test_stdout(self):
     self.assertEqual((None, 'xlsx-multiple'),
                      Client.ensure_format_ext(None, None))
     self.assertEqual((None, 'csv'), Client.ensure_format_ext(None, 'csv'))
Beispiel #4
0
 def test_incorrect_ext(self):
     self.assertEqual(('foo.txt.csv', 'csv'),
                      Client.ensure_format_ext('foo.txt', 'csv'))
     self.assertEqual(('foo.xlsx.csv', 'csv'),
                      Client.ensure_format_ext('foo.xlsx', 'csv'))
Beispiel #5
0
 def test_missing_ext(self):
     self.assertEqual(('foo.csv', 'csv'),
                      Client.ensure_format_ext('foo', 'csv'))