def test_migrates_v5_config():
    settings, version = _migrate({
        '_version': 5,
        'shortFixedTrash': True,
        'calibrateToBottom': True,
        'deckCalibrationDots': False,
        'disableHomeOnBoot': True,
        'useProtocolApi2': None,
        'useOldAspirationFunctions': True,
        'disableLogAggregation': False,
        'enableApi1BackCompat': False,
        'useV1HttpApi': False,
        'enableDoorSafetySwitch': True,
    })
    assert version == good_file_version
    assert settings == {
        'shortFixedTrash': True,
        'calibrateToBottom': True,
        'deckCalibrationDots': False,
        'disableHomeOnBoot': True,
        'useOldAspirationFunctions': True,
        'disableLogAggregation': False,
        'useProtocolApi2': None,
        'enableApi1BackCompat': False,
        'useV1HttpApi': False,
        'enableDoorSafetySwitch': True,
        'enableTipLengthCalibration': None
    }
Esempio n. 2
0
def test_ignores_invalid_keys():
    settings, version = _migrate({
      'split-labware-def': True,
      'splitLabwareDefinitions': True
    })

    assert version == good_file_version
    assert settings == good_file_settings
def test_migrates_empty_object():
    settings, version = _migrate({})

    assert (version == 2)
    assert (settings == {
        'shortFixedTrash': None,
        'calibrateToBottom': None,
        'deckCalibrationDots': None,
        'disableHomeOnBoot': None,
        'useProtocolApi2': None,
        'useOldAspirationFunctions': None,
        'disableLogAggregation': None
    })
def test_ignores_invalid_keys():
    settings, version = _migrate({
        'split-labware-def': True,
        'splitLabwareDefinitions': True
    })

    assert (version == 2)
    assert (settings == {
        'shortFixedTrash': None,
        'calibrateToBottom': None,
        'deckCalibrationDots': None,
        'disableHomeOnBoot': None,
        'useProtocolApi2': None,
        'useOldAspirationFunctions': None,
        'disableLogAggregation': None,
    })
Esempio n. 5
0
def test_migrates_versionless_old_config():
    settings, version = _migrate({
      'short-fixed-trash': False,
      'calibrate-to-bottom': False,
      'dots-deck-type': True,
      'disable-home-on-boot': False,
    })

    assert version == good_file_version
    assert settings == {
      'shortFixedTrash': None,
      'calibrateToBottom': None,
      'deckCalibrationDots': True,
      'disableHomeOnBoot': None,
      'useOldAspirationFunctions': None,
      'disableLogAggregation': None,
      'enableApi1BackCompat': None
    }
Esempio n. 6
0
def test_migrates_versionless_new_config():
    settings, version = _migrate({
      'shortFixedTrash': True,
      'calibrateToBottom': True,
      'deckCalibrationDots': False,
      'disableHomeOnBoot': True,
      'useProtocolApi2': False,
      'useOldAspirationFunctions': True,
    })

    assert version == good_file_version
    assert settings == {
      'shortFixedTrash': True,
      'calibrateToBottom': True,
      'deckCalibrationDots': None,
      'disableHomeOnBoot': True,
      'useOldAspirationFunctions': True,
      'disableLogAggregation': None,
      'enableApi1BackCompat': None,
    }
def test_migrates_v1_config():
    settings, version = _migrate({
        '_version': 1,
        'shortFixedTrash': True,
        'calibrateToBottom': True,
        'deckCalibrationDots': False,
        'disableHomeOnBoot': True,
        'useProtocolApi2': False,
        'useOldAspirationFunctions': True,
    })
    assert version == 2
    assert settings == {
        'shortFixedTrash': True,
        'calibrateToBottom': True,
        'deckCalibrationDots': False,
        'disableHomeOnBoot': True,
        'useProtocolApi2': False,
        'useOldAspirationFunctions': True,
        'disableLogAggregation': None
    }
Esempio n. 8
0
def test_migrates_empty_object():
    settings, version = _migrate({})

    assert version == good_file_version
    assert settings == good_file_settings