def test_should_add_an_init_container_if_git_sync_is_true(self):
    docs = render_chart(values={'images': {'gitSync': {'repository': 'test-registry/test-repo', 'tag': 'test-tag', 'pullPolicy': 'Always'}}, 'dags': {'gitSync': {'enabled': True, 'containerName': 'git-sync-test', 'wait': 66, 'maxFailures': 70, 'subPath': 'path1/path2', 'dest': 'test-dest', 'root': '/git-root', 'rev': 'HEAD', 'depth': 1, 'repo': 'https://github.com/apache/airflow.git', 'branch': 'test-branch', 'sshKeySecret': None, 'credentialsSecret': None, 'knownHosts': None}}}, show_only=['templates/pod-template-file.yaml'], chart_dir=self.temp_chart_dir)
    assert re.search('Pod', docs[0]['kind'])
    assert ({'name': 'git-sync-test', 'securityContext': {'runAsUser': 65533}, 'image': 'test-registry/test-repo:test-tag', 'imagePullPolicy': 'Always', 'env': [{'name': 'GIT_SYNC_REV', 'value': 'HEAD'}, {'name': 'GIT_SYNC_BRANCH', 'value': 'test-branch'}, {'name': 'GIT_SYNC_REPO', 'value': 'https://github.com/apache/airflow.git'}, {'name': 'GIT_SYNC_DEPTH', 'value': '1'}, {'name': 'GIT_SYNC_ROOT', 'value': '/git-root'}, {'name': 'GIT_SYNC_DEST', 'value': 'test-dest'}, {'name': 'GIT_SYNC_ADD_USER', 'value': 'true'}, {'name': 'GIT_SYNC_WAIT', 'value': '66'}, {'name': 'GIT_SYNC_MAX_SYNC_FAILURES', 'value': '70'}, {'name': 'GIT_SYNC_ONE_TIME', 'value': 'true'}], 'volumeMounts': [{'mountPath': '/git-root', 'name': 'dags'}]} == jmespath.search('spec.initContainers[0]', docs[0]))
def test_should_add_an_init_container_if_git_sync_is_true(self):
    docs = render_chart(values={'images': {'gitSync': {'repository': 'test-registry/test-repo', 'tag': 'test-tag', 'pullPolicy': 'Always'}}, 'dags': {'gitSync': {'enabled': True, 'containerName': 'git-sync-test', 'wait': 66, 'maxFailures': 70, 'subPath': 'path1/path2', 'dest': 'test-dest', 'root': '/git-root', 'rev': 'HEAD', 'depth': 1, 'repo': 'https://github.com/apache/airflow.git', 'branch': 'test-branch', 'sshKeySecret': None, 'credentialsSecret': None, 'knownHosts': None}}}, show_only=['templates/pod-template-file.yaml'], chart_dir=self.temp_chart_dir)
    assert re.search('Pod', docs[0]['kind'])
    assert ({'name': 'git-sync-test', 'securityContext': {'runAsUser': 65533}, 'image': 'test-registry/test-repo:test-tag', 'imagePullPolicy': 'Always', 'env': [{'name': 'GIT_SYNC_REV', 'value': 'HEAD'}, {'name': 'GIT_SYNC_BRANCH', 'value': 'test-branch'}, {'name': 'GIT_SYNC_REPO', 'value': 'https://github.com/apache/airflow.git'}, {'name': 'GIT_SYNC_DEPTH', 'value': '1'}, {'name': 'GIT_SYNC_ROOT', 'value': '/git-root'}, {'name': 'GIT_SYNC_DEST', 'value': 'test-dest'}, {'name': 'GIT_SYNC_ADD_USER', 'value': 'true'}, {'name': 'GIT_SYNC_WAIT', 'value': '66'}, {'name': 'GIT_SYNC_MAX_SYNC_FAILURES', 'value': '70'}, {'name': 'GIT_SYNC_ONE_TIME', 'value': 'true'}], 'volumeMounts': [{'mountPath': '/git-root', 'name': 'dags'}]} == jmespath.search('spec.initContainers[0]', docs[0]))