Exemple #1
0
    def test_invoke_flow_convert_font(self):
        self._register_invoke_flow_response(invoke_flow_convert_font_response)

        flow_state = self.flow_control_service.invoke_flow_request(
        ).set_invocation(
            Invocation(['convert-font'],
                       [Source('/source/font.ttf')])).set_flow(
                           Flow().add_component(
                               'convert-font',
                               Component(
                                   ComponentType.convert_font, [],
                                   ConvertFontSpecification(
                                       Destination('/destination/font.woff',
                                                   None, ACL.private),
                                       FontType.woff)))).execute()

        self._assert_flow(invoke_flow_convert_font_request, flow_state)
Exemple #2
0
    def test_invoke_flow_replace_extra_metadata(self):
        extra_metadata = AudioExtraMetadata(
            'track_name', 'artist', 'album_name', 'track_number', 'genre',
            'composer', 'year',
            Image('image_url', 'mime_type', 'image_description'),
            Lyrics('text', 'eng', 'lyrics_description'))

        self._register_invoke_flow_response(
            invoke_flow_replace_extra_metadata_response)

        flow_state = self.flow_control_service.invoke_flow_request(
        ).set_invocation(
            Invocation(['metadata1'], [Source('/source/path.mp3')])).set_flow(
                Flow().add_component(
                    'metadata1',
                    Component(
                        ComponentType.replace_extra_metadata, [],
                        ReplaceAudioExtraMetadataSpecification(
                            Destination('/destination/path.mp3', None,
                                        ACL.private),
                            extra_metadata)))).execute()

        self._assert_flow(invoke_flow_replace_extra_metadata_request,
                          flow_state)
    def deserialize(cls, data):
        # type: (dict) -> Flow
        components = {k: Component.deserialize(v) for k, v in data.items()}

        return Flow(components)