Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format with black #122

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Reformatted with Black
e77db53f6c52c37e8a0bfa79f7bf3f07f0fa19d8
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ repos:
args:
- --fix

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
Expand Down
140 changes: 70 additions & 70 deletions tests/config_data.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
echo_step = {
'step': {
'name': 'greeting',
'command': 'echo HELLO WORLD',
'image': 'busybox',
"step": {
"name": "greeting",
"command": "echo HELLO WORLD",
"image": "busybox",
},
}

list_step = {
'step': {
'name': 'list files',
'command': 'ls',
'image': 'busybox',
"step": {
"name": "list files",
"command": "ls",
"image": "busybox",
},
}

Expand Down Expand Up @@ -40,114 +40,114 @@
}

complex_step = {
'step': {
'name': 'run stuff',
'command': 'foo.py {parameters}',
'image': 'busybox',
'inputs': [
"step": {
"name": "run stuff",
"command": "foo.py {parameters}",
"image": "busybox",
"inputs": [
{
'name': 'foo',
'default': 'http://example.com/default/endpoint.zip',
"name": "foo",
"default": "http://example.com/default/endpoint.zip",
},
{
'name': 'foo2',
'default': 'http://example.com/default/herpderp.zip',
"name": "foo2",
"default": "http://example.com/default/herpderp.zip",
},
],
'parameters': [
"parameters": [
{
'name': 'i',
'type': 'integer',
'default': 10,
"name": "i",
"type": "integer",
"default": 10,
},
{
'name': 'f',
'type': 'float',
'default': 3.5,
"name": "f",
"type": "float",
"default": 3.5,
},
{
'name': 's',
'type': 'string',
'optional': True,
"name": "s",
"type": "string",
"optional": True,
},
],
},
}

complex_step_alt = {
'step': {
'name': 'run stuff',
'command': 'bar.py {parameters}',
'image': 'busybox',
'inputs': [
"step": {
"name": "run stuff",
"command": "bar.py {parameters}",
"image": "busybox",
"inputs": [
{
'name': 'foo',
'default': 'http://example.com/default/endpoint_alt.zip',
"name": "foo",
"default": "http://example.com/default/endpoint_alt.zip",
},
{
'name': 'bar',
'default': 'http://example.com/default/foobar.zip',
"name": "bar",
"default": "http://example.com/default/foobar.zip",
},
],
'parameters': [
"parameters": [
{
'name': 'i',
'type': 'integer',
'default': 11,
"name": "i",
"type": "integer",
"default": 11,
},
{
'name': 's',
'type': 'string',
'optional': True,
"name": "s",
"type": "string",
"optional": True,
},
{
'name': 's2',
'type': 'string',
'optional': False,
"name": "s2",
"type": "string",
"optional": False,
},
],
},
}

complex_steps_merged = {
'step': {
'name': 'run stuff',
'command': 'bar.py {parameters}',
'image': 'busybox',
'inputs': [
"step": {
"name": "run stuff",
"command": "bar.py {parameters}",
"image": "busybox",
"inputs": [
{
'name': 'foo',
'default': 'http://example.com/default/endpoint_alt.zip',
"name": "foo",
"default": "http://example.com/default/endpoint_alt.zip",
},
{
'name': 'foo2',
'default': 'http://example.com/default/herpderp.zip',
"name": "foo2",
"default": "http://example.com/default/herpderp.zip",
},
{
'name': 'bar',
'default': 'http://example.com/default/foobar.zip',
"name": "bar",
"default": "http://example.com/default/foobar.zip",
},
],
'parameters': [
"parameters": [
{
'name': 'i',
'type': 'integer',
'default': 11,
"name": "i",
"type": "integer",
"default": 11,
},
{
'name': 'f',
'type': 'float',
'default': 3.5,
"name": "f",
"type": "float",
"default": 3.5,
},
{
'name': 's',
'type': 'string',
'optional': True,
"name": "s",
"type": "string",
"optional": True,
},
{
'name': 's2',
'type': 'string',
'optional': False,
"name": "s2",
"type": "string",
"optional": False,
},
],
},
Expand Down
34 changes: 18 additions & 16 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
from tests.utils import config_fixture

example1_config = config_fixture('example1.yaml')
example2_config = config_fixture('example2.yaml')
example3_config = config_fixture('example3.yaml')
boolean_param_config = config_fixture('flag-param-example.yaml')
boolean_param_pass_as_config = config_fixture('flag-param-pass-as-example.yaml')
mount_config = config_fixture('mount-example.yaml')
endpoint_config = config_fixture('endpoint-example.yaml')
optional_default_param_config = config_fixture('optional-default-param.yaml')
pipeline_config = config_fixture('pipeline-example.yaml')
step_with_tasks = config_fixture('step-with-tasks.yaml')
pipeline_overridden_config = config_fixture('pipeline-with-override-example.yaml')
pipeline_with_tasks_config = config_fixture('pipeline-with-tasks-example.yaml')
pipeline_with_parameters_config = config_fixture('pipeline-with-parameters-example.yaml')
multiple_param_config = config_fixture('multiple-param.yaml')
input_extras_config = config_fixture('input-extras.yaml')
timeouts_config = config_fixture('timeouts-example.yaml')
example1_config = config_fixture("example1.yaml")
example2_config = config_fixture("example2.yaml")
example3_config = config_fixture("example3.yaml")
boolean_param_config = config_fixture("flag-param-example.yaml")
boolean_param_pass_as_config = config_fixture("flag-param-pass-as-example.yaml")
mount_config = config_fixture("mount-example.yaml")
endpoint_config = config_fixture("endpoint-example.yaml")
optional_default_param_config = config_fixture("optional-default-param.yaml")
pipeline_config = config_fixture("pipeline-example.yaml")
step_with_tasks = config_fixture("step-with-tasks.yaml")
pipeline_overridden_config = config_fixture("pipeline-with-override-example.yaml")
pipeline_with_tasks_config = config_fixture("pipeline-with-tasks-example.yaml")
pipeline_with_parameters_config = config_fixture(
"pipeline-with-parameters-example.yaml",
)
multiple_param_config = config_fixture("multiple-param.yaml")
input_extras_config = config_fixture("input-extras.yaml")
timeouts_config = config_fixture("timeouts-example.yaml")
50 changes: 29 additions & 21 deletions tests/consts.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import os

examples_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'examples'))
error_examples_path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'error_examples'))
warning_examples_path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'warning_examples'))
valid_examples_path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'valid_examples'))
examples_path = os.path.realpath(
os.path.join(os.path.dirname(__file__), "..", "examples"),
)
error_examples_path = os.path.realpath(
os.path.join(os.path.dirname(__file__), "error_examples"),
)
warning_examples_path = os.path.realpath(
os.path.join(os.path.dirname(__file__), "warning_examples"),
)
valid_examples_path = os.path.realpath(
os.path.join(os.path.dirname(__file__), "valid_examples"),
)

valid_bytes = b'''
valid_bytes = b"""
- step:
name: foo
command: foo
Expand All @@ -19,37 +27,37 @@
name: xyz
image: xyz
wsgi: hs:sh
'''
"""

invalid_obj = [
{
'step': {
'nerm': 'blerp',
"step": {
"nerm": "blerp",
},
},
]

valid_obj = [
{
'step': {
'name': 'foo',
'command': 'foo',
'image': 'foo',
"step": {
"name": "foo",
"command": "foo",
"image": "foo",
},
},
{
'endpoint': {
'name': 'xyz',
'image': 'xyz',
'port': 1453,
'server-command': './hs.sh',
"endpoint": {
"name": "xyz",
"image": "xyz",
"port": 1453,
"server-command": "./hs.sh",
},
},
{
'endpoint': {
'name': 'xyz',
'image': 'xyz',
'wsgi': 'hs:sh',
"endpoint": {
"name": "xyz",
"image": "xyz",
"wsgi": "hs:sh",
},
},
]
Loading