Changeset 40912 for branches/ipp-259_genericise_backups/tools/backups/backup_atlassian_applications_test.py
- Timestamp:
- Oct 4, 2019, 4:50:00 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/backup_atlassian_applications_test.py
r40898 r40912 9 9 import backups.full_atlassian_backup_test as fab_test 10 10 import backups.utils.subprocess_utils as sub_utils 11 import backups.utils.generic_utils as gen_utils 11 12 12 13 from backups.backup_atlassian_applications import AtlassianBackups 14 from backups.utils.errors import ValidationError 13 15 14 16 TEST_DEFAULT_CONFIG_FILE = os.path.join(os.path.dirname(__file__), './testing/test.config') … … 215 217 destination_paths = [ "/Two", "/paths"] 216 218 217 return_is_non_zero = baa._move_dir_contents_to_dir(source_paths, destination_paths)218 assert return_is_non_zero != 0219 with pytest.raises(ValidationError): 220 gen_utils.move_dirs(source_paths, destination_paths) 219 221 220 222 def test_moving_old_backups(self, tmpdir): … … 275 277 276 278 # run the move 277 return_result = baa._move_dir_contents_to_dir(source_paths, destination_paths)279 return_result = gen_utils.move_dirs(source_paths, destination_paths) 278 280 assert return_result == 0 279 281 … … 357 359 class TestTaringOfAttachments(object): 358 360 359 def test_ attachments_tar(self, tmpdir):361 def test_jira_attachments_tar(self, tmpdir): 360 362 361 363 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) … … 364 366 today = datetime.date.today().strftime("%Y_%m_%d") 365 367 jira_tar_name = today + "_jira_attachments.tar" 368 expected_jira_host_tar = os.path.join(ab.host_backup_path, "latest", jira_tar_name) 369 expected_jira_bak1_tar = os.path.join(ab.backup_1_path, "latest", jira_tar_name) 370 expected_jira_bak2_tar = os.path.join(ab.backup_2_path, "latest", jira_tar_name) 371 assert not os.path.exists(expected_jira_host_tar) 372 assert not os.path.exists(expected_jira_bak1_tar) 373 assert not os.path.exists(expected_jira_bak2_tar) 374 375 tar_result = ab._tar_jira_attachments() 376 assert tar_result == 0 377 378 assert os.path.exists(expected_jira_host_tar) 379 assert os.path.exists(expected_jira_bak1_tar) 380 assert os.path.exists(expected_jira_bak2_tar) 381 382 def test_conf_attachments_tar(self, tmpdir): 383 384 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 385 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 386 387 today = datetime.date.today().strftime("%Y_%m_%d") 366 388 conf_tar_name = today + "_confluence_attachments.tar" 367 expected_jira_host_tar = os.path.join(ab.host_backup_path, "latest", jira_tar_name)368 389 expected_conf_host_tar = os.path.join(ab.host_backup_path, "latest", conf_tar_name) 369 expected_jira_bak1_tar = os.path.join(ab.backup_1_path, "latest", jira_tar_name)370 390 expected_conf_bak1_tar = os.path.join(ab.backup_1_path, "latest", conf_tar_name) 371 expected_jira_bak2_tar = os.path.join(ab.backup_2_path, "latest", jira_tar_name)372 391 expected_conf_bak2_tar = os.path.join(ab.backup_2_path, "latest", conf_tar_name) 373 assert not os.path.exists(expected_jira_host_tar)374 392 assert not os.path.exists(expected_conf_host_tar) 375 assert not os.path.exists(expected_jira_bak1_tar)376 393 assert not os.path.exists(expected_conf_bak1_tar) 377 assert not os.path.exists(expected_jira_bak2_tar)378 394 assert not os.path.exists(expected_conf_bak2_tar) 379 395 380 tar_result = ab._tar_ attachments()396 tar_result = ab._tar_conf_attachments() 381 397 assert tar_result == 0 382 398 383 assert os.path.exists(expected_jira_host_tar)384 399 assert os.path.exists(expected_conf_host_tar) 385 assert os.path.exists(expected_jira_bak1_tar)386 400 assert os.path.exists(expected_conf_bak1_tar) 387 assert os.path.exists(expected_jira_bak2_tar)388 401 assert os.path.exists(expected_conf_bak2_tar) 389 402
Note:
See TracChangeset
for help on using the changeset viewer.
