code: def test_as_uri_raises_error_when_field_is_not_uri_or_absolute_path(
      self,
  ) -> None:
      with pytest.raises(
          AssetCardError,
          match=r"The value of the field 'field1' of the asset card 'test-card' must be a URI or an absolute pathname, but is 'foo1' instead\.$",
      ):
          self.card.field("field1").as_uri()
  
imports: from os import PathLike
  from pathlib import Path
  import pytest
  from fairseq2.assets import AssetCard, AssetCardError, AssetCardFieldNotFoundError
label_desc: Use image node_id 19 for calling the TestAssetCard obj's underlying member method code with example usage: obj.test_as_uri_raises_error_when_field_is_not_uri_or_absolute_path() without return types