Example #1
0
def test_empty_row_returns_false(mocker):
    mocker.patch('conductor.checks.TableChecker.get_data')

    patient = MetaTableChecker('sgid.fake.table', SECRETS['internalsgid'])
    response = patient.exists()

    assert response.exists == False
Example #2
0
def test_missing_all_returns_correct_string(mocker):
    mocker.patch('conductor.checks.TableChecker.get_data')
    patient = MetaTableChecker('sgid.fake.table', SECRETS['internalsgid'])
    patient.data = (None, None, None)

    response = patient.exists()

    assert response.exists == False
Example #3
0
def test_metatable_response_returns_true_when_exists():
    patient = MetaTableChecker('sgid.boundaries.municipalities',
                               SECRETS['internalsgid'])
    response = patient.exists()

    assert response.exists == True
    assert patient.data.item_id == '543fa1f073714198a3dbf8a292bdf30c'
    assert patient.data.item_name == 'Utah Municipal Boundaries'
Example #4
0
def test_missing_geometry_type_returns_correct_string(mocker):
    mocker.patch('conductor.checks.TableChecker.get_data')

    patient = MetaTableChecker('sgid.fake.table', SECRETS['internalsgid'])
    patient.data = ('some-guid', 'agol name', None)

    response = patient.exists()

    assert response.exists == 'missing geometry type'
Example #5
0
def test_missing_item_id_returns_correct_string(mocker):
    mocker.patch('conductor.checks.TableChecker.get_data')

    patient = MetaTableChecker('sgid.fake.table', SECRETS['internalsgid'])
    patient.data = (None, 'Agol Published Name', 'geometry type')

    response = patient.exists()

    assert response.exists == 'missing item id'
Example #6
0
def test_response_returns_completely_missing_for_fake_table():
    patient = MetaTableChecker('sgid.fake.table', SECRETS['internalsgid'])
    response = patient.exists()

    assert response.exists == False