Skip to content

Commit

Permalink
Format metabox using black
Browse files Browse the repository at this point in the history
Command used:

    black . --line-length 79 --extend-exclude "/vendor/"
  • Loading branch information
pieqq committed Apr 10, 2024
1 parent 1a876c7 commit 2a7e832
Show file tree
Hide file tree
Showing 29 changed files with 460 additions and 326 deletions.
30 changes: 15 additions & 15 deletions metabox/configs/checkbox-core-snap-classic-beta-config.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
configuration = {
'local': {
'origin': 'classic-snap',
'checkbox_core_snap': {'risk': 'beta'},
'checkbox_snap': {'risk': 'stable'},
'releases': ['bionic', 'focal'],
"local": {
"origin": "classic-snap",
"checkbox_core_snap": {"risk": "beta"},
"checkbox_snap": {"risk": "stable"},
"releases": ["bionic", "focal"],
},
'controller': {
'origin': 'classic-snap',
'checkbox_core_snap': {'risk': 'beta'},
'checkbox_snap': {'risk': 'stable'},
'releases': ['focal'],
"controller": {
"origin": "classic-snap",
"checkbox_core_snap": {"risk": "beta"},
"checkbox_snap": {"risk": "stable"},
"releases": ["focal"],
},
'agent': {
'origin': 'classic-snap',
'checkbox_core_snap': {'risk': 'beta'},
'checkbox_snap': {'risk': 'stable'},
'releases': ['bionic', 'focal'],
"agent": {
"origin": "classic-snap",
"checkbox_core_snap": {"risk": "beta"},
"checkbox_snap": {"risk": "stable"},
"releases": ["bionic", "focal"],
},
}
24 changes: 12 additions & 12 deletions metabox/configs/dev-ppa-config.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
configuration = {
'local': {
'origin': 'ppa',
'uri': 'ppa:checkbox-dev/ppa',
'releases': ['bionic', 'focal'],
"local": {
"origin": "ppa",
"uri": "ppa:checkbox-dev/ppa",
"releases": ["bionic", "focal"],
},
'controller': {
'origin': 'ppa',
'uri': 'ppa:checkbox-dev/ppa',
'releases': ['focal'],
"controller": {
"origin": "ppa",
"uri": "ppa:checkbox-dev/ppa",
"releases": ["focal"],
},
'agent': {
'origin': 'ppa',
'uri': 'ppa:checkbox-dev/ppa',
'releases': ['bionic', 'focal'],
"agent": {
"origin": "ppa",
"uri": "ppa:checkbox-dev/ppa",
"releases": ["bionic", "focal"],
},
}
6 changes: 3 additions & 3 deletions metabox/configs/local-source-16.04.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
configuration = {
'local': {
"local": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['xenial'],
"origin": "source",
"releases": ["xenial"],
},
}
6 changes: 3 additions & 3 deletions metabox/configs/local-source-18.04.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
configuration = {
'local': {
"local": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['bionic'],
"origin": "source",
"releases": ["bionic"],
},
}
6 changes: 3 additions & 3 deletions metabox/configs/local-source-20.04.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
configuration = {
'local': {
"local": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['focal'],
"origin": "source",
"releases": ["focal"],
},
}
6 changes: 3 additions & 3 deletions metabox/configs/local-source-22.04.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
configuration = {
'local': {
"local": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['jammy'],
"origin": "source",
"releases": ["jammy"],
},
}
12 changes: 6 additions & 6 deletions metabox/configs/remote-source-16.04.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
configuration = {
'controller': {
"controller": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['xenial'],
"origin": "source",
"releases": ["xenial"],
},
'agent': {
'origin': 'source',
'releases': ['xenial'],
"agent": {
"origin": "source",
"releases": ["xenial"],
},
}
12 changes: 6 additions & 6 deletions metabox/configs/remote-source-18.04.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
configuration = {
'controller': {
"controller": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['bionic'],
"origin": "source",
"releases": ["bionic"],
},
'agent': {
'origin': 'source',
'releases': ['bionic'],
"agent": {
"origin": "source",
"releases": ["bionic"],
},
}
12 changes: 6 additions & 6 deletions metabox/configs/remote-source-20.04.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
configuration = {
'controller': {
"controller": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['focal'],
"origin": "source",
"releases": ["focal"],
},
'agent': {
'origin': 'source',
'releases': ['focal'],
"agent": {
"origin": "source",
"releases": ["focal"],
},
}
12 changes: 6 additions & 6 deletions metabox/configs/remote-source-22.04.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
configuration = {
'controller': {
"controller": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
'releases': ['jammy'],
"origin": "source",
"releases": ["jammy"],
},
'agent': {
'origin': 'source',
'releases': ['jammy'],
"agent": {
"origin": "source",
"releases": ["jammy"],
},
}
8 changes: 4 additions & 4 deletions metabox/configs/source-local-config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
configuration = {
'local': {
"local": {
# Metabox can run tests from a local directory containing a copy of
# the Checkbox source code repository.
'origin': 'source',
"origin": "source",
# Path to the Checkbox source code repository
'uri': '~/dev/work/checkbox',
'releases': ['focal'],
"uri": "~/dev/work/checkbox",
"releases": ["focal"],
},
}
16 changes: 8 additions & 8 deletions metabox/configs/source-remote-config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
configuration = {
'controller': {
'origin': 'source',
'uri': '~/dev/work/checkbox',
'releases': ['focal'],
"controller": {
"origin": "source",
"uri": "~/dev/work/checkbox",
"releases": ["focal"],
},
'agent': {
'origin': 'source',
'uri': '~/dev/work/checkbox',
'releases': ['focal'],
"agent": {
"origin": "source",
"uri": "~/dev/work/checkbox",
"releases": ["focal"],
},
}
24 changes: 12 additions & 12 deletions metabox/configs/testing-ppa-config.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
configuration = {
'local': {
'origin': 'ppa',
'uri': 'ppa:checkbox-dev/testing',
'releases': ['focal', 'jammy'],
"local": {
"origin": "ppa",
"uri": "ppa:checkbox-dev/testing",
"releases": ["focal", "jammy"],
},
'controller': {
'origin': 'ppa',
'uri': 'ppa:checkbox-dev/testing',
'releases': ['focal'],
"controller": {
"origin": "ppa",
"uri": "ppa:checkbox-dev/testing",
"releases": ["focal"],
},
'agent': {
'origin': 'ppa',
'uri': 'ppa:checkbox-dev/testing',
'releases': ['focal', 'jammy'],
"agent": {
"origin": "ppa",
"uri": "ppa:checkbox-dev/testing",
"releases": ["focal", "jammy"],
},
}
56 changes: 35 additions & 21 deletions metabox/metabox/core/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,24 @@
"""

__all__ = [
"Start", "Expect", "Send", "SelectTestPlan",
"AssertPrinted", "AssertNotPrinted", "AssertRetCode",
"AssertAgentActive", "Sleep", "RunCmd", "Signal", "Reboot",
"NetUp", "NetDown", "Put", "MkTree", "RunManage", "AssertInFile"
"Start",
"Expect",
"Send",
"SelectTestPlan",
"AssertPrinted",
"AssertNotPrinted",
"AssertRetCode",
"AssertAgentActive",
"Sleep",
"RunCmd",
"Signal",
"Reboot",
"NetUp",
"NetDown",
"Put",
"MkTree",
"RunManage",
"AssertInFile",
]


Expand All @@ -37,72 +51,72 @@ def __init__(self, *args, **kwargs):
self.kwargs = kwargs

def __call__(self, scn):
assert(self.handler is not None)
assert self.handler is not None
getattr(scn, self.handler)(*self.args, **self.kwargs)


class Start(ActionBase):
handler = 'start'
handler = "start"


class Expect(ActionBase):
handler = 'expect'
handler = "expect"


class ExpectNot(ActionBase):
handler = 'expect_not'
handler = "expect_not"


class Send(ActionBase):
handler = 'send'
handler = "send"


class SelectTestPlan(ActionBase):
handler = 'select_test_plan'
handler = "select_test_plan"


class AssertPrinted(ActionBase):
handler = 'assert_printed'
handler = "assert_printed"


class AssertNotPrinted(ActionBase):
handler = 'assert_not_printed'
handler = "assert_not_printed"


class AssertRetCode(ActionBase):
handler = 'assert_ret_code'
handler = "assert_ret_code"


class AssertAgentActive(ActionBase):
handler = 'is_agent_active'
handler = "is_agent_active"


class Sleep(ActionBase):
handler = 'sleep'
handler = "sleep"


class RunCmd(ActionBase):
handler = 'run_cmd'
handler = "run_cmd"


class Signal(ActionBase):
handler = 'signal'
handler = "signal"


class Reboot(ActionBase):
handler = 'reboot'
handler = "reboot"


class NetUp(ActionBase):
handler = 'switch_on_networking'
handler = "switch_on_networking"


class NetDown(ActionBase):
handler = 'switch_off_networking'
handler = "switch_off_networking"


class Put(ActionBase):
handler = 'put'
handler = "put"


class MkTree(ActionBase):
Expand Down
Loading

0 comments on commit 2a7e832

Please sign in to comment.