Index: /branches/ipp-132_automate_jira_conf_backups/backups/atlassian_backups.config
===================================================================
--- /branches/ipp-132_automate_jira_conf_backups/backups/atlassian_backups.config	(revision 40893)
+++ /branches/ipp-132_automate_jira_conf_backups/backups/atlassian_backups.config	(revision 40893)
@@ -0,0 +1,10 @@
+[atlassian_backups]
+host_backup_path = /export/ippops4.0/atlassian_backups
+backup_1_path = /data/ippops3.0/atlassian_backups
+backup_2_path = /data/ippops5.0/atlassian_backups
+jira_backup_path = /var/atlassian/application-data/jira/export
+conf_backup_path = /var/atlassian/application-data/confluence/backups
+jira_attachments_path = /var/atlassian/application-data/jira/data
+conf_attachments_path = /var/atlassian/application-data/confluence/attachments
+mysqldump_password = not_a_real_password
+verbose = True
Index: /branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py
===================================================================
--- /branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py	(revision 40892)
+++ /branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py	(revision 40893)
@@ -1,6 +1,6 @@
 import argparse
+import configparser
 import datetime
 import glob
-import operator
 import os
 import os.path as path
@@ -16,25 +16,16 @@
 
 
-DEFAULT_ATLASSIAN_HOST = "ippops4"
-DEFAULT_BACKUP_MACHINE_1 = "ippops3"
-DEFAULT_BACKUP_MACHINE_2 = "ippops5"
-DEFAULT_BACKUP_HOST = "/export/{0}.0/atlassian_backups".format(DEFAULT_ATLASSIAN_HOST)
-DEFAULT_BACKUP_1_DIR = "/data/{0}.0/atlassian_backups".format(DEFAULT_BACKUP_MACHINE_1)
-DEFAULT_BACKUP_2_DIR = "/data/{0}.0/atlassian_backups".format(DEFAULT_BACKUP_MACHINE_2)
-
-DEFAULT_ATLASSIAN_HOME_DIR = "/var/atlassian/application-data/"
-DEFAULT_JIRA_BACKUP_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "jira/export")
-DEFAULT_CONF_BACKUP_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "confluence/backups")
-DEFAULT_JIRA_ATTACHMENTS_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "jira/data")
-DEFAULT_CONF_ATTACHMENTS_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "confluence/attachments")
-
-DEFAULT_VERBOSITY = False
-
-
-class SubprocessError(Exception):
-    """Errors in Popen stderr subprocess"""
-
-
-def _move_dir_contents_to_dir(source_dirs: [str], destination_dirs: [str]):
+DEFAULT_CONFIG_FILE = path.abspath('./atlassian_backups.config')
+
+
+class ConfigError(Exception):
+    """Error in loading the config file"""
+
+    def __init__(self, config_item, message):
+        self.config_item = config_item
+        self.message = message
+
+
+def _move_dir_contents_to_dir(source_dirs: [str], destination_dirs: [str], verbose: bool=False):
     """ Moves all files from inside source paths to the destination dits.
 It's important to note that it moves index to index
@@ -64,5 +55,6 @@
         try:
             for fp in filepaths:
-                print("Moving: {0} -> {1}".format(fp, destination_dirs[i]))
+                if verbose:
+                    print("Moving: {0} -> {1}".format(fp, destination_dirs[i]))
                 command_and_args = ["mv", fp, destination_dirs[i]]
                 # shutil.move(fp, destination_dirs[i])
@@ -77,70 +69,33 @@
 class AtlassianBackups():
 
-    def __init__(self,
-                 host_backup_path=None,
-                 backup_1_path=None,
-                 backup_2_path=None,
-                 jira_backup_path=None,
-                 conf_backup_path=None,
-                 jira_attachments_path=None,
-                 conf_attachments_path=None,
-                 verbose=None):
-
-        self.host_backup_path      = DEFAULT_BACKUP_HOST          if host_backup_path      is None else host_backup_path
-        self.backup_1_path         = DEFAULT_BACKUP_1_DIR         if backup_1_path         is None else backup_1_path
-        self.backup_2_path         = DEFAULT_BACKUP_2_DIR         if backup_2_path         is None else backup_2_path
-        self.jira_backup_path      = DEFAULT_JIRA_BACKUP_DIR      if jira_backup_path      is None else jira_backup_path
-        self.conf_backup_path      = DEFAULT_CONF_BACKUP_DIR      if conf_backup_path      is None else conf_backup_path
-        self.jira_attachments_path = DEFAULT_JIRA_ATTACHMENTS_DIR if jira_attachments_path is None else jira_attachments_path
-        self.conf_attachments_path = DEFAULT_CONF_ATTACHMENTS_DIR if conf_attachments_path is None else conf_attachments_path
-        self.verbose               = DEFAULT_VERBOSITY            if verbose               is None else verbose
-
-    host_backup_path = property(operator.attrgetter('_host_backup_path'))
-
-    @host_backup_path.setter
-    def host_backup_path(self, value):
-        self._host_backup_path = value
-
-    backup_1_path = property(operator.attrgetter('_backup_1_path'))
-
-    @backup_1_path.setter
-    def backup_1_path(self, value):
-        self._backup_1_path = value
-
-    backup_2_path = property(operator.attrgetter('_backup_2_path'))
-
-    @backup_2_path.setter
-    def backup_2_path(self, value):
-        self._backup_2_path = value
-
-    jira_backup_path = property(operator.attrgetter('_jira_backup_path'))
-
-    @jira_backup_path.setter
-    def jira_backup_path(self, value):
-        self._jira_backup_path = value
-
-    conf_backup_path = property(operator.attrgetter('_conf_backup_path'))
-
-    @conf_backup_path.setter
-    def conf_backup_path(self, value):
-        self._conf_backup_path = value
-
-    jira_attachments_path = property(operator.attrgetter('_jira_attachments_path'))
-
-    @jira_attachments_path.setter
-    def jira_attachments_path(self, value):
-        self._jira_attachments_path = value
-
-    conf_attachments_path = property(operator.attrgetter('_conf_attachments_path'))
-
-    @conf_attachments_path.setter
-    def conf_attachments_path(self, value):
-        self._conf_attachments_path = value
-
-    verbose = property(operator.attrgetter('_verbose'))
-
-    @verbose.setter
-    def verbose(self, home_dir):
-        self._verbose = home_dir
+    def __init__(self, config_file=None):
+        self.config_file = DEFAULT_CONFIG_FILE if config_file is None else config_file
+        self.load_config(self.config_file)
+
+    def load_config(self, config_class_or_filepath):
+        """Accepts a filepath to a config file, or """
+
+        config = configparser.ConfigParser()
+        if config_class_or_filepath is None:
+            raise ConfigError(config_class_or_filepath, "Neither config settings or filepath of config given")
+        elif isinstance(config_class_or_filepath, configparser.ConfigParser):
+            config = config_class_or_filepath
+        elif path.exists(config_class_or_filepath):
+            config.read(config_class_or_filepath)
+
+        def _get_str_key_from_section(config, section, key):
+            if config.has_option(section, key):
+                return config[section][key]
+            raise ConfigError(config, "ConfigError: KeyError: no key found for {0}".format(key))
+
+        section = 'atlassian_backups'
+        self.host_backup_path      = _get_str_key_from_section(config, section, 'host_backup_path')
+        self.backup_1_path         = _get_str_key_from_section(config, section, 'backup_1_path')
+        self.backup_2_path         = _get_str_key_from_section(config, section, 'backup_2_path')
+        self.jira_backup_path      = _get_str_key_from_section(config, section, 'jira_backup_path')
+        self.conf_backup_path      = _get_str_key_from_section(config, section, 'conf_backup_path')
+        self.jira_attachments_path = _get_str_key_from_section(config, section, 'jira_attachments_path')
+        self.conf_attachments_path = _get_str_key_from_section(config, section, 'conf_attachments_path')
+        self.verbose               = config.getboolean('atlassian_backups', 'verbose')
 
     def target_backup_paths_ok(self) -> bool:
@@ -184,23 +139,21 @@
 
         # Move latest to tmp (and delete if move ok)
-        _move_dir_contents_to_dir(latest_paths, tmp_paths)
+        _move_dir_contents_to_dir(latest_paths, tmp_paths, self.verbose)
 
         # copy jira
-        jira_return = self._copy_jira_backup()
+        jira_return = self._copy_jira_backup(self.verbose)
 
         # copy confluence
-        conf_return = self._copy_confluence_backup()
+        conf_return = self._copy_confluence_backup(self.verbose)
 
         # tarfiles:
         tar_return = self._tar_attachments()
 
-        # make mysql dump
-
         # If successful: move tmp to old
         if jira_return == 0 and conf_return == 0 and tar_return == 0:
-            _move_dir_contents_to_dir(tmp_paths, old_paths)
+            _move_dir_contents_to_dir(tmp_paths, old_paths, self.verbose)
         else:
             # If any failed: delete latest, move tmp back
-            _move_dir_contents_to_dir(tmp_paths, latest_paths)
+            _move_dir_contents_to_dir(tmp_paths, latest_paths, self.verbose)
             return 5
 
@@ -216,5 +169,5 @@
         return datetime.date.today().strftime(jira_format)
 
-    def _copy_jira_backup(self):
+    def _copy_jira_backup(self, verbose=False):
         if not self.target_backup_paths_ok():
             return 2
@@ -222,5 +175,4 @@
         jira_wildcard_search = "{0}/{1}*".format(self.jira_backup_path, self.get_jira_backup_date_format())
         jira_xml_filepaths = glob.glob(jira_wildcard_search)
-        print(len(jira_xml_filepaths))
         if len(jira_xml_filepaths) == 0:
             print("Copy Failure: No jira backups found at: ", jira_wildcard_search)
@@ -233,6 +185,8 @@
                     return 2
                 try:
-                    print("Copying: {0} to {1}".format(jfile, tpath))
+                    if verbose:
+                        print("Copying: {0} to {1}".format(jfile, tpath))
                     shutil.copy2(jfile, tpath)
+                    sub_utils.chmod_wrapper(['774', os.path.join(tpath, os.path.basename(jfile))])
                 except IOError as e:
                     print("Error: copying jira backup.\n  copying: {0}\n  to: {1}".format(e.filename, e.filename2))
@@ -248,5 +202,5 @@
         return datetime.date.today().strftime(conf_format)
 
-    def _copy_confluence_backup(self):
+    def _copy_confluence_backup(self, verbose=False):
         if not self.target_backup_paths_ok():
             print("Copy Failure: target path failure")
@@ -255,5 +209,4 @@
         conf_wildcard_search = "{0}/*{1}*.zip".format(self.conf_backup_path, self.get_confluence_backup_date_format())
         conf_xml_filepaths = glob.glob(conf_wildcard_search)
-        print(len(conf_xml_filepaths))
         if len(conf_xml_filepaths) == 0:
             print("Copy Failure: No confluence backups found at: ", conf_wildcard_search)
@@ -263,6 +216,6 @@
             for tpath in target_paths:
                 try:
-                    print("using cp wrapper")
                     sub_utils.cp_wrapper([cfile, tpath])
+                    sub_utils.chmod_wrapper(['774', os.path.join(tpath, os.path.basename(cfile))])
                 except Exception as e:
                     print(e)
@@ -279,6 +232,6 @@
         jira_tar_filepath = path.join(latest_paths[0], jira_tar_name)
         jira_tar_args = ["-cf", jira_tar_filepath, self.jira_attachments_path]
-        print(jira_tar_args)
         sub_utils.tar_wrapper(jira_tar_args)
+        sub_utils.chmod_wrapper(['774', jira_tar_filepath])
         # copy to backups
         sub_utils.cp_wrapper([ jira_tar_filepath, latest_paths[1]])
@@ -289,6 +242,6 @@
         confluence_tar_filepath = path.join(latest_paths[0], confluence_tar_name)
         confluence_tar_args = ["-cf", confluence_tar_filepath, self.conf_attachments_path]
-        print(confluence_tar_args)
         sub_utils.tar_wrapper(confluence_tar_args)
+        sub_utils.chmod_wrapper(['774', confluence_tar_filepath])
         # copy to backups
         sub_utils.cp_wrapper([ confluence_tar_filepath, latest_paths[1]])
@@ -326,5 +279,5 @@
             decoded_stderr = stde.decode()
             if decoded_stderr.casefold().find('error'.casefold()) > -1:
-                raise SubprocessError()
+                raise sub_utils.SubprocessError()
 
         # move the dump file to the correct locations
@@ -343,6 +296,5 @@
 
     def run(self):
-        self.perform_atlassian_backups()
-        return 0
+        return self.perform_atlassian_backups()
 
 
@@ -351,5 +303,5 @@
     args_dict = vars(args)
     ab = AtlassianBackups(**args_dict)
-    ab.run()
+    return ab.run()
 
 
@@ -359,35 +311,8 @@
         description='Performs backup of atlassian applications\nYou should run this on the machine hosting the atlassian applications')
 
-    parser.add_argument('--host_backup_path',
+    parser.add_argument('--config_file',
         nargs='?',
-        help='absolute path of where the backups should be copied to on the host',
-        default=DEFAULT_BACKUP_HOST)
-    parser.add_argument('--backup_1_dir',
-        nargs='?',
-        help='directory of where backups should be copied to',
-        default=DEFAULT_BACKUP_1_DIR)
-    parser.add_argument('--backup_2_dir',
-        nargs='?',
-        help='second directory of where backups should be copied to',
-        default=DEFAULT_BACKUP_1_DIR)
-    parser.add_argument('--jira_backup_dir',
-        nargs='?',
-        help='directory where the zipped xml backups are located',
-        default=DEFAULT_JIRA_BACKUP_DIR)
-    parser.add_argument('--conf_backup_dir',
-        nargs='?',
-        help='directory where the confluence xml backups are located',
-        default=DEFAULT_CONF_BACKUP_DIR)
-    parser.add_argument('--jira_attachments_dir',
-        nargs='?',
-        help='direcory of where the jira attachments are located',
-        default=DEFAULT_JIRA_ATTACHMENTS_DIR)
-    parser.add_argument('--conf_attachments_dir',
-        nargs='?',
-        help='directory of where the confluence attachments are located',
-        default=DEFAULT_CONF_ATTACHMENTS_DIR)
-    parser.add_argument('--verbose', '-v',
-        action='store_true',
-        help='will print some verbose messages')
+        help='contains config for all paths and mysqldump details',
+        default=DEFAULT_CONFIG_FILE)
 
     return parser.parse_args()
Index: /branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications_test.py
===================================================================
--- /branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications_test.py	(revision 40892)
+++ /branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications_test.py	(revision 40893)
@@ -1,3 +1,4 @@
 import backup_atlassian_applications as baa
+import configparser
 import datetime
 import os
@@ -7,12 +8,42 @@
 
 import full_atlassian_backup_test as fab_test
+import utils.subprocess_utils as sub_utils
 
 from backup_atlassian_applications import AtlassianBackups
 
+TEST_DEFAULT_CONFIG_FILE = "./testing/test.config"
+
+
+def make_config(tmpdir) -> configparser.ConfigParser:
+    config = configparser.ConfigParser()
+    config['atlassian_backups'] = \
+    {
+        'host_backup_path'      : os.path.join(tmpdir, 'host_backup_path'),
+        'backup_1_path'         : os.path.join(tmpdir, 'backup_1_path'),
+        'backup_2_path'         : os.path.join(tmpdir, 'backup_2_path'),
+        'jira_backup_path'      : os.path.join(tmpdir, 'jira_backup_path'),
+        'conf_backup_path'      : os.path.join(tmpdir, 'conf_backup_path'),
+        'jira_attachments_path' : os.path.join(tmpdir, 'jira_attachments_path'),
+        'conf_attachments_path' : os.path.join(tmpdir, 'conf_attachments_path')
+    }
+
 
 class TestArguments(object):
 
-    def test_default_arguments(self):
-
+    def test_load_from_config_file(self):
+
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
+
+        assert ab.host_backup_path      == "/export/ippops4.0/atlassian_backups"
+        assert ab.backup_1_path         == "/data/ippops3.0/atlassian_backups"
+        assert ab.backup_2_path         == "/data/ippops5.0/atlassian_backups"
+        assert ab.jira_backup_path      == "/var/atlassian/application-data/jira/export"
+        assert ab.conf_backup_path      == "/var/atlassian/application-data/confluence/backups"
+        assert ab.jira_attachments_path == "/var/atlassian/application-data/jira/data"
+        assert ab.conf_attachments_path == "/var/atlassian/application-data/confluence/attachments"
+        assert ab.verbose is True
+
+    def test_default_config_loads_with_no_args(self):
+        assert os.path.exists("./atlassian_backups.config")
         ab = AtlassianBackups()
         assert ab.host_backup_path      == "/export/ippops4.0/atlassian_backups"
@@ -24,21 +55,47 @@
         assert ab.conf_attachments_path == "/var/atlassian/application-data/confluence/attachments"
 
-    def test_providing_args(self):
-        ab = AtlassianBackups(host_backup_path="/host/backup/path",
-                              backup_1_path="/backup/1/path",
-                              backup_2_path="/backup/2/path",
-                              jira_backup_path="/jira/backup/path",
-                              conf_backup_path="/conf/backup/path",
-                              jira_attachments_path="/jira/attachments/path",
-                              conf_attachments_path="/conf/attachments/path",
-                              verbose=True)
-
-        assert ab.host_backup_path      == "/host/backup/path"
-        assert ab.backup_1_path         == "/backup/1/path"
-        assert ab.backup_2_path         == "/backup/2/path"
-        assert ab.jira_backup_path      == "/jira/backup/path"
-        assert ab.conf_backup_path      == "/conf/backup/path"
-        assert ab.jira_attachments_path == "/jira/attachments/path"
-        assert ab.conf_attachments_path == "/conf/attachments/path"
+    def test_default_arguments(self):
+
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
+        assert ab.host_backup_path      == "/export/ippops4.0/atlassian_backups"
+        assert ab.backup_1_path         == "/data/ippops3.0/atlassian_backups"
+        assert ab.backup_2_path         == "/data/ippops5.0/atlassian_backups"
+        assert ab.jira_backup_path      == "/var/atlassian/application-data/jira/export"
+        assert ab.conf_backup_path      == "/var/atlassian/application-data/confluence/backups"
+        assert ab.jira_attachments_path == "/var/atlassian/application-data/jira/data"
+        assert ab.conf_attachments_path == "/var/atlassian/application-data/confluence/attachments"
+
+    def test_providing_config_directly(self):
+        config = configparser.ConfigParser()
+        config.add_section("atlassian_backups")
+        config.set('atlassian_backups', 'host_backup_path',      'custom_config1')
+        config.set('atlassian_backups', 'backup_1_path',         'custom_config2')
+        config.set('atlassian_backups', 'backup_2_path',         'custom_config3')
+        config.set('atlassian_backups', 'jira_backup_path',      'custom_config4')
+        config.set('atlassian_backups', 'conf_backup_path',      'custom_config5')
+        config.set('atlassian_backups', 'jira_attachments_path', 'custom_config6')
+        config.set('atlassian_backups', 'conf_attachments_path', 'custom_config7')
+        config.set('atlassian_backups', 'verbose', 'False')
+
+        ab = AtlassianBackups(config_file=config)
+
+        assert ab.host_backup_path      == 'custom_config1'
+        assert ab.backup_1_path         == 'custom_config2'
+        assert ab.backup_2_path         == 'custom_config3'
+        assert ab.jira_backup_path      == 'custom_config4'
+        assert ab.conf_backup_path      == 'custom_config5'
+        assert ab.jira_attachments_path == 'custom_config6'
+        assert ab.conf_attachments_path == 'custom_config7'
+        assert ab.verbose is False
+
+    def test_nonexistant_config_file_raises_error(self):
+        with pytest.raises(baa.ConfigError):
+            AtlassianBackups("not a real file path")
+
+    def test_default_config_loads_from_main_call(self):
+        try:
+            baa.main()
+        except Exception:
+            pytest.fail("An error was raised when it should not")
 
 
@@ -46,9 +103,9 @@
 
     def test_default_target_paths_do_not_exists_in_testing(self):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         assert ab.target_backup_paths_ok() is False
 
     def test_an_incorrect_path_then_correct_path(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
 
         assert os.path.exists(ab.jira_backup_path) is False
@@ -57,5 +114,5 @@
 
     def test_each_path_individually(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
 
         assert os.path.exists(ab.host_backup_path) is False
@@ -92,5 +149,5 @@
 
     def test_backup_subdirs_are_created_if_missing(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab.jira_path = tmpdir
         ab.conf_path = tmpdir
@@ -126,5 +183,5 @@
 
     def test_target_paths_with_defaults_function(self):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
 
         default = ab.target_paths('default_paths')
@@ -135,5 +192,5 @@
 
     def test_target_paths_function_after_changing_paths(self):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
 
         ab.host_backup_path = "/different_path/for_host"
@@ -232,5 +289,5 @@
 
     def test_get_jira_backup_date_format(self):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         today = datetime.date.today()
         expected_format = today.strftime("%Y-%b-%d")
@@ -238,5 +295,5 @@
 
     def test_copying_fails_if_paths_not_present(self):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         return_value = ab._copy_jira_backup()
         assert return_value != 0
@@ -246,5 +303,5 @@
 
     def test_jira_copy(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
 
@@ -253,5 +310,5 @@
 
     def test_get_confluence_backup_date_format(self):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         today = datetime.date.today()
         expected_format = today.strftime("%Y_%m_%d")
@@ -259,5 +316,5 @@
 
     def test_confluence_copy(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
 
@@ -266,5 +323,5 @@
 
     def test_full_copy(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
 
@@ -274,5 +331,5 @@
 
     def test_atlsssian_copying_fails_when_paths_do_not_exist(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         fake_path = "/not/a/real/path"
         ab.jira_backup_path = fake_path
@@ -295,5 +352,5 @@
     def test_attachments_tar(self, tmpdir):
 
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
 
@@ -340,5 +397,5 @@
 
     def test_mysql_dump_is_ok(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
 
@@ -354,5 +411,5 @@
 
     def test_mysql_dump_is_ok_to_custom_file(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
 
@@ -367,12 +424,7 @@
 
     def test_mysql_dump_fails_with_incorrect_password(self, tmpdir):
-        ab = AtlassianBackups()
-        ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
-
-        with pytest.raises(baa.SubprocessError):
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
+        ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
+
+        with pytest.raises(sub_utils.SubprocessError):
             ab.make_mysql_dump("Not the correct password")
-
-# class TestTidyingOfFiles(object):
-
-#     def test_tidying(self):
-#         assert False is True
Index: /branches/ipp-132_automate_jira_conf_backups/backups/full_atlassian_backup_test.py
===================================================================
--- /branches/ipp-132_automate_jira_conf_backups/backups/full_atlassian_backup_test.py	(revision 40892)
+++ /branches/ipp-132_automate_jira_conf_backups/backups/full_atlassian_backup_test.py	(revision 40893)
@@ -1,8 +1,11 @@
 import datetime
 import os
+import backup_atlassian_applications as baa
 
 from pathlib import Path
 
 from backup_atlassian_applications import AtlassianBackups
+
+TEST_DEFAULT_CONFIG_FILE = "./testing/test.config"
 
 
@@ -137,5 +140,5 @@
 
     def test_entire_process(self, tmpdir):
-        ab = AtlassianBackups()
+        ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE)
         ab = create_all_paths_and_folders(ab, tmpdir)
 
Index: /branches/ipp-132_automate_jira_conf_backups/backups/testing/test.config
===================================================================
--- /branches/ipp-132_automate_jira_conf_backups/backups/testing/test.config	(revision 40893)
+++ /branches/ipp-132_automate_jira_conf_backups/backups/testing/test.config	(revision 40893)
@@ -0,0 +1,10 @@
+[atlassian_backups]
+host_backup_path = /export/ippops4.0/atlassian_backups
+backup_1_path = /data/ippops3.0/atlassian_backups
+backup_2_path = /data/ippops5.0/atlassian_backups
+jira_backup_path = /var/atlassian/application-data/jira/export
+conf_backup_path = /var/atlassian/application-data/confluence/backups
+jira_attachments_path = /var/atlassian/application-data/jira/data
+conf_attachments_path = /var/atlassian/application-data/confluence/attachments
+mysqldump_password = not_a_real_password
+verbose = True
