Ejemplo n.º 1
0
	def test_output_as_required_option(self):
		options = Values({
			'project_path': '/tmp/',
			'output': None,
			'format': 'html',
			'create_project': None,
		})
		opt = OptionsValidator(options)
		# make the path a valid one =)
		opt.has_project_metadata = Mock()
		opt.has_project_metadata.return_value = True
		self.assertRaisesRegex(ValueError, 'Output path must be declared', opt.validate)
Ejemplo n.º 2
0
	def test_new_project_with_format_option(self):
		options = Values({
			'project_path': '/tmp/',
			'output': None,
			'format': 'html',
			'create_project': True,
		})
		opt = OptionsValidator(options)
		# make the path a valid one =)
		opt.has_project_metadata = Mock()
		opt.has_project_metadata.return_value = True
		self.assertRaisesRegex(ValueError, "Format cannot be declared", opt.validate)
Ejemplo n.º 3
0
 def test_output_as_required_option(self):
     options = Values({
         'project_path': '/tmp/',
         'output': None,
         'format': 'html',
         'create_project': None,
     })
     opt = OptionsValidator(options)
     # make the path a valid one =)
     opt.has_project_metadata = Mock()
     opt.has_project_metadata.return_value = True
     self.assertRaisesRegex(ValueError, 'Output path must be declared',
                            opt.validate)
Ejemplo n.º 4
0
 def test_new_project_with_format_option(self):
     options = Values({
         'project_path': '/tmp/',
         'output': None,
         'format': 'html',
         'create_project': True,
     })
     opt = OptionsValidator(options)
     # make the path a valid one =)
     opt.has_project_metadata = Mock()
     opt.has_project_metadata.return_value = True
     self.assertRaisesRegex(ValueError, "Format cannot be declared",
                            opt.validate)
Ejemplo n.º 5
0
	def test_new_project(self):
		options = Values({
			'project_path': '/tmp/',
			'output': None,
			'format': None,
			'create_project': True,
		})
		opt = OptionsValidator(options)
		# make the path a valid one =)
		opt.has_project_metadata = Mock()
		opt.has_project_metadata.return_value = True
		try:
			opt.validate()
		except ValueError as e:
			self.assertTrue(False, "should never hit this line")
Ejemplo n.º 6
0
 def test_new_project(self):
     options = Values({
         'project_path': '/tmp/',
         'output': None,
         'format': None,
         'create_project': True,
     })
     opt = OptionsValidator(options)
     # make the path a valid one =)
     opt.has_project_metadata = Mock()
     opt.has_project_metadata.return_value = True
     try:
         opt.validate()
     except ValueError as e:
         self.assertTrue(False, "should never hit this line")