- Timestamp:
- Oct 14, 2019, 4:59:32 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/jira_backup_test.py
r40937 r40944 116 116 self.assert_defaults(jb) 117 117 118 def test_default_config_loads_with_no_args(self): 119 default_config = jbck_mod.DEFAULT_CONFIG_FILE 120 assert os.path.exists(default_config) 121 jb = JiraBackup() 122 self.assert_defaults(jb) 118 def test_default_config_fails_to_load_if_the_file_does_not_exist(self): 119 default_config = jbck_mod.EXPECTED_CONFIG_FILE 120 assert not os.path.exists(default_config) 121 122 with pytest.raises(errs.ValidationError) as e: 123 JiraBackup() 124 assert "ValidationError: Config filepath does not exist" in str(e) 123 125 124 126 def test_default_arguments(self): … … 166 168 167 169 def test_nonexistant_config_file_raises_error(self): 168 with pytest.raises(errs. ConfigError):170 with pytest.raises(errs.ValidationError) as e: 169 171 JiraBackup("not a real file path") 172 assert "ValidationError: Config filepath does not exist" in str(e) 170 173 171 174 def test_main_loads_default_and_fails_due_to_missing_paths(self): 172 175 with pytest.raises(errs.ValidationError) as e: 173 176 jbck_mod.main() 174 assert "ValidationError: target path does not exist:" in str(e)177 assert "ValidationError: Config filepath does not exist" in str(e) 175 178 176 179
Note:
See TracChangeset
for help on using the changeset viewer.
