def set_up_modules(): delete_if_arcpy_exists(TEMP_GDB) engine.init() core.init(engine.log) yield delete_if_arcpy_exists(TEMP_GDB)
def test_git_update(self, _validate_repo_mock, _get_repo_mock, clone_from_mock): remote_mock = Mock() remote_mock.pull = Mock() remote_mock.pull.return_value = [] repo_mock = Mock() repo_mock.remotes = [remote_mock] _get_repo_mock.return_value = repo_mock _validate_repo_mock.return_value = '' engine.init() config.set_config_prop('warehouse', test_pallets_folder, override=True) config.set_config_prop('repositories', ['agrc/nested', 'agrc/forklift']) results = engine.git_update() clone_from_mock.assert_called_once() remote_mock.pull.assert_called_once() self.assertEqual(len(results), 0)
def test_init_creates_default_config_file(self): path = engine.init() self.assertTrue(exists(path)) with open(path) as config: config_dict = loads(config.read()) self.assertEqual( config_dict, { u'changeDetectionTables': [], u'configuration': u'Production', u'dropoffLocation': u'c:\\forklift\\data\\receiving', u'email': { u'smtpServer': u'send.state.ut.us', u'smtpPort': 25, u'apiKey': '', u'fromAddress': u'*****@*****.**', }, u'hashLocation': u'c:\\forklift\\data\\hashed', u'notify': [u'*****@*****.**'], u'repositories': [], u'sendEmails': False, u'servers': { u'options': { u'protocol': u'http', u'port': 6080, u'username': u'', u'password': u'' }, u'primary': { u'machineName': u'machine.name.here' } }, u'shipTo': u'c:\\forklift\\data\\production', u'warehouse': u'c:\\forklift\\warehouse', u'serverStartWaitSeconds': 300 })
def test_init_returns_path_for_existing_config_file(self): self.assertEqual(engine.init(), engine.init())
def setUp(self): engine.init()