esptest.common.fs module

esptest.common.fs.get_file_bytes(path_or_url, *, timeout=None)[source]

Read raw bytes from a local path or http(s) URL.

Parameters:
  • path_or_url (str)

  • timeout (float | None)

Return type:

bytes

esptest.common.fs.get_file_text(path_or_url, *, encoding='utf-8', errors='replace', timeout=None)[source]

Read text from a local path or http(s) URL.

Local paths use text mode (same newline translation as Path.read_text). HTTP(S) URLs decode raw response bytes via to_str.

Parameters:
  • path_or_url (str)

  • encoding (str)

  • errors (str)

  • timeout (float | None)

Return type:

str