コード例 #1
0
def test_validate_config_with_missing_language_key(mock_toml_load):
    mock_toml_load.return_value = toml.loads("""
        name = "wings"
        description = "Weeeee"

        [runtime]
        service = "lambda"
    """)

    with pytest.raises(KeyError):
        ValidateConfig('/fake_path_yo/wings.toml').config
コード例 #2
0
def test_validate_config_with_invalid_service_value(mock_toml_load):
    mock_toml_load.return_value = toml.loads("""
        name = "wings"
        description = "Weeeee"

        [runtime]
        service = "blah"
        language = "python36"
    """)

    with pytest.raises(ValueError):
        ValidateConfig('/fake_path_yo/wings.toml').config
コード例 #3
0
ファイル: wings.py プロジェクト: irlrobot/wings
def main():
    """ Main function for wings """
    print("Starting wings...")
    args = parse_args()

    if args.up:
        config = ValidateConfig(os.getcwd() + "/wings.toml").config
        print(config)
        toolchain = Toolchain(config)
        toolchain.build_toolchain()

    print("Success!")
    sys.exit(0)
コード例 #4
0
def test_validate_config_with_valid_data(mock_toml_load):
    mock_toml_load.return_value = toml.loads("""
        name = "wings"
        description = "Weeeee"

        [runtime]
        service = "lambda"
        language = "python36"
    """)

    config = ValidateConfig('/fake_path_yo/wings.toml').config

    assert config == {
        'description': 'Weeeee',
        'name': 'wings',
        'runtime': {
            'language': 'python36',
            'service': 'lambda'
        }
    }