Beispiel #1
0
 def test_works_with_relative_filename(self):
     filename = '../valid'
     self.assertEqual(filename, resolve_given_outfile_path(filename))
Beispiel #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)
Beispiel #3
0
 def test_only_validates_filename_when_set(self):
     resolve_given_outfile_path(None)
Beispiel #4
0
 def test_works_with_valid_filename(self):
     filename = self.files.create_file('valid', '')
     self.assertEqual(filename, resolve_given_outfile_path(filename))
Beispiel #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)
Beispiel #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)
Beispiel #7
0
 def test_works_with_relative_filename(self):
     filename = "../valid"
     self.assertEquals(filename, resolve_given_outfile_path(filename))
Beispiel #8
0
 def test_works_with_valid_filename(self):
     filename = self.files.create_file("valid", "")
     self.assertEquals(filename, resolve_given_outfile_path(filename))
Beispiel #9
0
 def test_only_validates_filename_when_set(self):
     resolve_given_outfile_path(None)
Beispiel #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)
Beispiel #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)