Exemple #1
0
 def test_validate_ts_tr(self):
     input_1 = [100, 200]
     input_2 = ([0, 0], [0, 50], [10, 0], [-1, 10], [10, -100], [-100, -100])
     input_3 = [10]
     self.assertEqual(Domain._validate_ts_tr(input_1), None)
     for inp in input_2:
         with self.assertRaises(ValueError) as opt_err:
             Domain._validate_ts_tr(inp)
             self.assertEqual(opt_err.args[0], 'Resolution or width and height must be bigger '
                                               'than 0: <-tr x_resolution y_resolution> or '
                                               '<-ts width height>')
     with self.assertRaises(ValueError) as opt_err:
         Domain._validate_ts_tr(input_3)
         self.assertEqual(opt_err.args[0], '-ts and -tr requires exactly 2 parameters '
                                           '(1 given): <-tr x_resolution y_resolution> or '
                                           '<-ts width height>')
Exemple #2
0
 def test_validate_ts_tr(self):
     input_1 = [100, 200]
     input_2 = ([0, 0], [0, 50], [10, 0], [-1, 10], [10, -100], [-100, -100])
     input_3 = [10]
     self.assertEqual(Domain._validate_ts_tr(input_1), None)
     for inp in input_2:
         with self.assertRaises(ValueError) as opt_err:
             Domain._validate_ts_tr(inp)
             self.assertEqual(opt_err.args[0], 'Resolution or width and height must be bigger '
                                               'than 0: <-tr x_resolution y_resolution> or '
                                               '<-ts width height>')
     with self.assertRaises(ValueError) as opt_err:
         Domain._validate_ts_tr(input_3)
         self.assertEqual(opt_err.args[0], '-ts and -tr requires exactly 2 parameters '
                                           '(1 given): <-tr x_resolution y_resolution> or '
                                           '<-ts width height>')