def test_use_global_config(self): """ Verify that JJB uses the global config file by default """ args = self.parser.parse_args(['test', 'foo']) self.assertEqual(cmd.get_config_file(args), '/etc/jenkins_jobs/jenkins_jobs.ini')
def test_use_config_in_user_home(self): """ Verify that JJB uses config file in user home folder """ args = self.parser.parse_args(['test', 'foo']) # args.output_dir = mock.MagicMock() # mock_isfile.side_effect = True expected_loc = os.path.join(os.path.expanduser('~'), '.config', 'jenkins_jobs', 'jenkins_jobs.ini') with patch('os.path.isfile', return_value=True): self.assertEqual(cmd.get_config_file(args), expected_loc)