Exemple #1
0
    def test_invalid_coord(self):
        with open('test/resources/invalid_coord.fcsv', 'r') as fcsv:
            with self.assertRaises(model_auto.InvalidFcsvError) as cm:
                fcsv_json = model_auto.csv_to_json(fcsv)

        self.assertEqual(cm.exception.message,
                         'z in row 2 is not a real number')
Exemple #2
0
    def test_invalid_version(self):
        with open('test/resources/invalid_version.fcsv', 'r') as fcsv:
            with self.assertRaises(model_auto.InvalidFcsvError) as cm:
                fcsv_json = model_auto.csv_to_json(fcsv)

        self.assertEqual(cm.exception.message,
                         'Markups fiducial file version 3.5 too low')
Exemple #3
0
    def test_incorrect_desc(self):
        with open('test/resources/incorrect_desc.fcsv', 'r') as fcsv:
            with self.assertRaises(model_auto.InvalidFcsvError) as cm:
                fcsv_json = model_auto.csv_to_json(fcsv)

        self.assertEqual(cm.exception.message,
                         'Row label 2 does not match row description dummy')
Exemple #4
0
    def test_too_many_columns(self):
        with open('test/resources/too_many_columns.fcsv', 'r') as fcsv:
            with self.assertRaises(model_auto.InvalidFcsvError) as cm:
                fcsv_json = model_auto.csv_to_json(fcsv)

        self.assertEqual(cm.exception.message,
                         'Incorrect number of columns (15) in row 2')
Exemple #5
0
    def test_missing_row(self):
        with open('test/resources/missing_row_10.fcsv', 'r') as fcsv:
            with self.assertRaises(model_auto.InvalidFcsvError) as cm:
                fcsv_json = model_auto.csv_to_json(fcsv)

        self.assertEqual(cm.exception.message, 'Too few rows')
Exemple #6
0
 def test_valid(self):
     with open('test/resources/valid.fcsv', 'r') as fcsv:
         fcsv_json = model_auto.csv_to_json(fcsv)
Exemple #7
0
    def test_too_many_rows(self):
        with open('test/resources/too_many_rows.fcsv', 'r') as fcsv:
            with self.assertRaises(model_auto.InvalidFcsvError) as cm:
                fcsv_json = model_auto.csv_to_json(fcsv)

        self.assertEqual(cm.exception.message, 'Too many rows')