Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    def test_create_bundle(self):
        """Test to create a new bundle"""
        acc = common.get_admin_gpserviceaccount()
        client = GPClient(acc)

        tresp = client.create_bundle("test-bundle")

        common.my_assert_equal(self, "SUCCESS", tresp["status"],
                               'bundle could not be created')