def test_is_valid_name_bad_name():
    validator = IncidentFieldValidator('temp_file', check_git=False)
    validator.current_incident_field = {
        'cliName': 'sanity name',
        'name': 'Incident',
        'content': True,
    }

    assert not validator.is_valid_name()
    assert not validator.is_valid()

    validator.current_incident_field = {
        'cliName': 'sanity name',
        'name': 'case',
        'content': True,
    }
    assert not validator.is_valid_name()
    assert not validator.is_valid()

    validator.current_incident_field = {
        'cliName': 'sanity name',
        'name': 'Playbook',
        'content': True,
    }
    assert not validator.is_valid_name()
    assert not validator.is_valid()

    validator.current_incident_field = {
        'cliName': 'sanity name',
        'name': 'Alerting feature',
        'content': True,
    }
    assert not validator.is_valid_name()
    assert not validator.is_valid()

    validator.current_incident_field = {
        'cliName': 'sanity name',
        'name': 'INciDeNts',
        'content': True,
    }
    assert not validator.is_valid_name()
    assert not validator.is_valid()
def test_is_valid_name_sanity():
    validator = IncidentFieldValidator('temp_file', check_git=False)
    validator.current_incident_field = {
        'cliName': 'sanity name',
        'name': 'sanity name',
        'id': 'incident',
        'content': True,
    }

    assert validator.is_valid_name()
    assert validator.is_valid()