Closed imjoseangel closed 3 years ago
# Found no testable functions in
# {<powerline_k8sstatus.segments.K8SStatusSegment object at 0x10e228dd0>} from (<module 'powerline_k8sstatus' from '/Users/imjoseangel/.pyenv/versions/3.7.9/Python.framework/Versions/3.7/lib/python3.7/site-packages/powerline_k8sstatus/__init__.py'>,)
hypothesis write --style=pytest kubernetes.config
# This test code was written by the `hypothesis.extra.ghostwriter` module
# and is provided under the Creative Commons Zero public domain dedication.
import kubernetes.config.kube_config
from hypothesis import given, strategies as st
@given(config_file=st.none())
def test_fuzz_list_kube_config_contexts(config_file):
kubernetes.config.kube_config.list_kube_config_contexts(config_file=config_file)
@given(
config_file=st.none(),
context=st.none(),
client_configuration=st.none(),
persist_config=st.booleans(),
)
def test_fuzz_load_kube_config(
config_file, context, client_configuration, persist_config
):
kubernetes.config.kube_config.load_kube_config(
config_file=config_file,
context=context,
client_configuration=client_configuration,
persist_config=persist_config,
)
@given(config_file=st.none(), context=st.none(), persist_config=st.booleans())
def test_fuzz_new_client_from_config(config_file, context, persist_config):
kubernetes.config.kube_config.new_client_from_config(
config_file=config_file, context=context, persist_config=persist_config
)
Close as it is not needed
SUMMARY
Check how to implement Hypothesis for testing
ISSUE TYPE
COMPONENT NAME
Unit Testing
ADDITIONAL INFORMATION
Review documentation here and some examples here