code: def test_valid_weight_rules(self):
      assert WeightRule.is_valid(WeightRule.DOWNSTREAM)
      assert WeightRule.is_valid(WeightRule.UPSTREAM)
      assert WeightRule.is_valid(WeightRule.ABSOLUTE)
      assert len(WeightRule.all_weight_rules()) == 3
  
      with pytest.raises(ValueError):
          WeightRule("NOT_EXIST_WEIGHT_RULE")
  
imports: from __future__ import annotations
  import pytest
  from airflow.utils.weight_rule import WeightRule
label_desc: Use image node_id 1 for calling the TestWeightRule obj's underlying member method code with example usage: obj.test_valid_weight_rules() without return types