def test_should_create_valid_affinity_and_node_selector(self):
    docs = render_chart(values={'affinity': {'nodeAffinity': {'requiredDuringSchedulingIgnoredDuringExecution': {'nodeSelectorTerms': [{'matchExpressions': [{'key': 'foo', 'operator': 'In', 'values': ['true']}]}]}}}, 'tolerations': [{'key': 'dynamic-pods', 'operator': 'Equal', 'value': 'true', 'effect': 'NoSchedule'}], 'nodeSelector': {'diskType': 'ssd'}}, show_only=['templates/pod-template-file.yaml'], chart_dir=self.temp_chart_dir)
    assert re.search('Pod', docs[0]['kind'])
    assert ('foo' == jmespath.search('spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key', docs[0]))
    assert ('ssd' == jmespath.search('spec.nodeSelector.diskType', docs[0]))
    assert ('dynamic-pods' == jmespath.search('spec.tolerations[0].key', docs[0]))
def test_should_create_valid_affinity_and_node_selector(self):
    docs = render_chart(values={'affinity': {'nodeAffinity': {'requiredDuringSchedulingIgnoredDuringExecution': {'nodeSelectorTerms': [{'matchExpressions': [{'key': 'foo', 'operator': 'In', 'values': ['true']}]}]}}}, 'tolerations': [{'key': 'dynamic-pods', 'operator': 'Equal', 'value': 'true', 'effect': 'NoSchedule'}], 'nodeSelector': {'diskType': 'ssd'}}, show_only=['templates/pod-template-file.yaml'], chart_dir=self.temp_chart_dir)
    assert re.search('Pod', docs[0]['kind'])
    assert ('foo' == jmespath.search('spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key', docs[0]))
    assert ('ssd' == jmespath.search('spec.nodeSelector.diskType', docs[0]))
    assert ('dynamic-pods' == jmespath.search('spec.tolerations[0].key', docs[0]))