code: def test_profileresult():
      pr = ProfileResult()
      assert pr.exception is None
      assert pr.success
      assert bool(pr)
  
      pr.start = datetime.now()
      pr.name = "the name"
      pr.scope = "the scope"
      pr.target = "the target"
      pr.success = False
      pr.warnings = []
      pr.exception = ProfileException()
      pr.result = "the result"
      pr.end = datetime.now()
  
      assert pr.name == "the name"
      assert pr.scope == "the scope"
      assert pr.target == "the target"
      assert pr.result == "the result"
      assert pr.success is False
      assert bool(pr) is False
      assert pr.warnings == []
      assert isinstance(pr.exception, ProfileException)
      assert isinstance(pr.start, datetime)
      assert isinstance(pr.end, datetime)
      assert pr.end >= pr.start
  
      assert pr["name"] == pr.name
      assert pr["scope"] == pr.scope
      assert pr["target"] == pr.target
      assert pr["result"] == pr.result
      assert pr["success"] == pr.success
      assert pr["exception"] == pr.exception
      assert pr["start"] == pr.start
      assert pr["end"] == pr.end
  
      pr.exception = None
      assert dict(pr) == {
          "name": pr.name,
          "scope": pr.scope,
          "target": pr.target,
          "result": pr.result,
          "success": pr.success,
          "warnings": pr.warnings,
          "exception": pr.exception,
          "start": pr.start,
          "end": pr.end,
      }
  
      for k, val in pr:
          assert isinstance(k, str)
          assert val == getattr(pr, k)
  
      assert len(pr.keys()) == len(pr.values())
      assert len(pr.items()) == len(pr.values())
  
file_path: tslumen/tests/unit/profile/test_base.py
imports: import pytest
  from typing import Union
  from dataclasses import is_dataclass
  from datetime import datetime
  import pandas
  from tslumen.profile.base import ProfileException, ProfileResult, ProfilingFunction, BundledProfiler, BundledResult, valid_timeseries
label_desc: Use image node_id 3 for calling a global function with example usage: test_profileresult() without return types