code: def test_from_string():
      test_string = "Hello, world!"
      b = ByteStream.from_string(test_string)
      assert b.data.decode() == test_string
      assert b.mime_type == None
  
      b = ByteStream.from_string(test_string, mime_type="text/plain")
      assert b.data.decode() == test_string
      assert b.mime_type == "text/plain"
  
imports: import io
  from haystack.dataclasses import ByteStream
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_from_string() without return types