Exemple #1
0
    def test_handle_not_found(self):
        """Validate exception when lookup cannot be resolved."""
        query = "NOT_VALID"

        with self.assertRaises(ValueError):
            VarLookup.handle(query, context=None, variables=VARIABLES)
Exemple #2
0
    def test_handle_false_result(self):
        """Validate that a bool value of False can be resolved."""
        query = "false_val"
        result = VarLookup.handle(query, context=None, variables=VARIABLES)

        self.assertFalse(result)
Exemple #3
0
    def test_handle(self):
        """Validate handle base functionality."""
        query = "str_val"
        result = VarLookup.handle(query, context=None, variables=VARIABLES)

        self.assertEqual(result, "test")
Exemple #4
0
 def test_handle_not_found(self, runway_context: MockRunwayContext) -> None:
     """Validate exception when lookup cannot be resolved."""
     with pytest.raises(ValueError):
         VarLookup.handle("NOT_VALID", context=runway_context, variables=VARIABLES)
Exemple #5
0
 def test_handle_false_result(self, runway_context: MockRunwayContext) -> None:
     """Validate that a bool value of False can be resolved."""
     assert not VarLookup.handle(
         "false_val", context=runway_context, variables=VARIABLES
     )
Exemple #6
0
 def test_handle(self, runway_context: MockRunwayContext) -> None:
     """Validate handle base functionality."""
     assert (
         VarLookup.handle("str_val", context=runway_context, variables=VARIABLES)
         == "test"
     )