Ejemplo n.º 1
0
    def invoke(cls, web_client, channel, filepath):
        mimetype = FileTool.filepath2mimetype(filepath)
        filetype = SlackFiletype.mimetype2filetype(mimetype)

        j_files_upload_in = {
            "channels": channel,
            "file": filepath,
            "filename": os.path.basename(filepath),
            "filetype": filetype,
        }

        response = web_client.files_upload(**j_files_upload_in)
        return response
Ejemplo n.º 2
0
    def test_01(self):
        filepath = os.path.join(os.path.dirname(FILE_DIR), "file_tool.py")
        hyp = FileTool.filepath2mimetype(filepath)

        self.assertEqual(hyp, MimetypeTool.V.TEXT_XPYTHON)