docstr: sql-via-http:
  upload file
  delete file
  upload file again
docstr_tok: ["sql-via-http",":","upload","file","delete","file","upload","file","again"]
code: def test_files(self):
      """sql-via-http:
      upload file
      delete file
      upload file again
      """
      files_list = self.get_files_list()
      assert len(files_list) == 0
  
      if Path("train.csv").is_file() is False:
          resp = requests.get(
              "https://raw.githubusercontent.com/mindsdb/mindsdb-examples/master/classics/home_rentals/dataset/train.csv"
          )
          with open("tests/train.csv", "wb") as f:
              f.write(resp.content)
  
      file_path = Path("tests/train.csv")
      df = pd.read_csv(file_path)
      test_csv_path = make_test_csv("test_home_rentals", df.head(50))
      small_test_csv_path = make_test_csv(
          "small_test_home_rentals", df.head(5)
      )
  
      with open(test_csv_path) as td:
          files = {
              "file": ("test_data.csv", td, "text/csv"),
              "original_file_name": (
                  None,
                  "super_test_data.csv",
              ),  # optional
          }
  
          response = requests.request(
              "PUT",
              f"{HTTP_API_ROOT}/files/test_file",
              files=files,
              json=None,
              params=None,
              data=None,
          )
          assert response.status_code == 200
  
      files_list = self.get_files_list()
      assert files_list[0]["name"] == "test_file"
  
      response = requests.delete(f"{HTTP_API_ROOT}/files/test_file")
      assert response.status_code == 200
  
      files_list = self.get_files_list()
      assert len(files_list) == 0
  
      with open(test_csv_path) as td:
          files = {
              "file": ("test_data.csv", td, "text/csv"),
              "original_file_name": (
                  None,
                  "super_test_data.csv",
              ),  # optional
          }
  
          response = requests.request(
              "PUT",
              f"{HTTP_API_ROOT}/files/test_file",
              files=files,
              json=None,
              params=None,
              data=None,
          )
          assert response.status_code == 200
  
      with open(small_test_csv_path) as td:
          files = {"file": ("small_test_data.csv", td, "text/csv")}
  
          response = requests.request(
              "PUT",
              f"{HTTP_API_ROOT}/files/small_test_file",
              files=files,
              json=None,
              params=None,
              data=None,
          )
          assert response.status_code == 200
  
imports: from pathlib import Path
  import json
  import requests
  import pandas
  import pytest
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .conftest import make_test_csv
  from .http_test_helpers import HTTPHelperMixin
label_desc: Use image node_id 7 for calling the TestHTTP obj's underlying member method code with example usage: obj.test_files() without return types