def test_framework_run_operator(): """Check for Operator Framework was successful.""" checker = Framework() with patch.object(Framework, "_check_operator", lambda self, path: True): result = checker.run("somepath") assert result == Framework.Result.operator assert checker.text == "The charm is based on the Operator Framework."
def test_framework_run_unknown(): """No check for any framework was successful.""" checker = Framework() with patch.object(Framework, "_check_operator", lambda self, path: False): with patch.object(Framework, "_check_reactive", lambda self, path: False): result = checker.run("somepath") assert result == Framework.Result.unknown assert checker.text == "The charm is not based on any known Framework."
def test_framework_run_reactive(): """Check for Reactive Framework was successful.""" checker = Framework() with patch.object(Framework, "_check_operator", lambda self, path: False): with patch.object(Framework, "_check_reactive", lambda self, path: True): result = checker.run("somepath") assert result == Framework.Result.reactive assert checker.text == "The charm is based on the Reactive Framework."