Esempio n. 1
0
 def test_works_with_relative_filename(self):
     filename = '../valid'
     self.assertEqual(filename, resolve_given_outfile_path(filename))
Esempio n. 2
0
 def test_raises_when_cannot_write_to_file(self):
     filename = os.sep.join(['_path', 'not', '_exist_', 'file.xyz'])
     with self.assertRaises(ValueError):
         resolve_given_outfile_path(filename)
Esempio n. 3
0
 def test_only_validates_filename_when_set(self):
     resolve_given_outfile_path(None)
Esempio n. 4
0
 def test_works_with_valid_filename(self):
     filename = self.files.create_file('valid', '')
     self.assertEqual(filename, resolve_given_outfile_path(filename))
Esempio n. 5
0
 def test_raises_when_cannot_write_to_file(self):
     filename = os.sep.join(["_path", "not", "_exist_", "file.xyz"])
     with self.assertRaises(ValueError):
         resolve_given_outfile_path(filename)
Esempio n. 6
0
 def add_to_params(self, parameters, value):
     # Validate the file here so we can raise an error prior
     # calling the service.
     value = resolve_given_outfile_path(value)
     super(FileArgument, self).add_to_params(parameters, value)
Esempio n. 7
0
 def test_works_with_relative_filename(self):
     filename = "../valid"
     self.assertEquals(filename, resolve_given_outfile_path(filename))
Esempio n. 8
0
 def test_works_with_valid_filename(self):
     filename = self.files.create_file("valid", "")
     self.assertEquals(filename, resolve_given_outfile_path(filename))
Esempio n. 9
0
 def test_only_validates_filename_when_set(self):
     resolve_given_outfile_path(None)
Esempio n. 10
0
 def test_raises_when_cannot_write_to_file(self):
     filename = os.sep.join(['_path', 'not', '_exist_', 'file.xyz'])
     with self.assertRaises(ValueError):
         resolve_given_outfile_path(filename)
Esempio n. 11
0
 def add_to_params(self, parameters, value):
     # Validate the file here so we can raise an error prior
     # calling the service.
     value = resolve_given_outfile_path(value)
     super(FileArgument, self).add_to_params(parameters, value)