def setUpClass(self): """Setting up the globalization pipeline for testing""" acc = common.get_admin_gpserviceaccount() client = GPClient(acc) try: client.delete_bundle(common.bundleId1) client.delete_bundle(common.bundleId2) data = {} data['sourceLanguage'] = "en" data['targetLanguages'] = ["fr", "es-mx"] data['notes'] = ["string"] data['metadata'] = {} data['partner'] = '' data['segmentSeparatorPattern'] = 'string' data['noTranslationPattern'] = 'string' client.create_bundle(common.bundleId1, data=data) bundle1_entries = {} bundle1_entries['greet'] = "Hello" bundle1_entries['weather'] = "It is snowing" client.upload_resource_entries(common.bundleId1, "en", data=bundle1_entries) client.create_bundle(common.bundleId2, data=data) bundle2_entries = {} bundle2_entries['exit'] = "Goodbye" bundle2_entries['show'] = "The Wire" client.upload_resource_entries(common.bundleId2, "en", data=bundle2_entries) except: pass
def test_upload_resource_entries(self): """Test to upload resource entries""" acc = common.get_admin_gpserviceaccount() client = GPClient(acc) data = {} data["welcome"] = "Hello" tresp = client.upload_resource_entries(common.bundleId1, "en", data=data) common.my_assert_equal( self, "SUCCESS", tresp["status"], 'bundle resource entries could not be uploaded')