Slightly more Guidelines adjustments
This commit is contained in:
parent
2fa8b3c41b
commit
4907c9cf58
@ -4,9 +4,10 @@ import time
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
from solar.dblayer.model import get_bucket
|
||||||
from solar.dblayer.model import Model
|
from solar.dblayer.model import Model
|
||||||
from solar.dblayer.model import ModelMeta
|
from solar.dblayer.model import ModelMeta
|
||||||
from solar.dblayer.model import get_bucket
|
|
||||||
|
|
||||||
|
|
||||||
def patched_get_bucket_name(cls):
|
def patched_get_bucket_name(cls):
|
||||||
|
@ -23,7 +23,6 @@ from solar.events.controls import Dep
|
|||||||
from solar.events.controls import React
|
from solar.events.controls import React
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def create_event(event_dict):
|
def create_event(event_dict):
|
||||||
etype = event_dict['etype']
|
etype = event_dict['etype']
|
||||||
kwargs = {'child': event_dict['child'],
|
kwargs = {'child': event_dict['child'],
|
||||||
|
@ -36,7 +36,6 @@ from solar.dblayer.model import DBLayerNotFound
|
|||||||
from solar.dblayer.solar_models import Resource
|
from solar.dblayer.solar_models import Resource
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Event(object):
|
class Event(object):
|
||||||
|
|
||||||
etype = None
|
etype = None
|
||||||
|
@ -30,7 +30,6 @@ from solar import utils
|
|||||||
from solar.core.consts import CHANGES
|
from solar.core.consts import CHANGES
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def guess_action(from_, to):
|
def guess_action(from_, to):
|
||||||
# NOTE(dshulyak) imo the way to solve this - is dsl for orchestration,
|
# NOTE(dshulyak) imo the way to solve this - is dsl for orchestration,
|
||||||
# something where this action will be excplicitly specified
|
# something where this action will be excplicitly specified
|
||||||
@ -256,7 +255,6 @@ def _discard_update(item):
|
|||||||
old_connections, new_connections)
|
old_connections, new_connections)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _discard_run(item):
|
def _discard_run(item):
|
||||||
resource.load(item.resource).remove(force=True)
|
resource.load(item.resource).remove(force=True)
|
||||||
|
|
||||||
|
@ -17,9 +17,9 @@ import time
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from solar.core.resource import Resource
|
from solar.core.resource import Resource
|
||||||
|
from solar.dblayer.model import get_bucket
|
||||||
from solar.dblayer.model import Model
|
from solar.dblayer.model import Model
|
||||||
from solar.dblayer.model import ModelMeta
|
from solar.dblayer.model import ModelMeta
|
||||||
from solar.dblayer.model import get_bucket
|
|
||||||
|
|
||||||
|
|
||||||
def patched_get_bucket_name(cls):
|
def patched_get_bucket_name(cls):
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import networkx as nx
|
import networkx as nx
|
||||||
|
|
||||||
from mock import patch
|
from mock import patch
|
||||||
from pytest import fixture
|
from pytest import fixture
|
||||||
|
|
||||||
from solar.orchestration import executor
|
from solar.orchestration import executor
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ def staged():
|
|||||||
]}
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@fixture
|
@fixture
|
||||||
def commited():
|
def commited():
|
||||||
return {'id': 'res.1',
|
return {'id': 'res.1',
|
||||||
@ -45,7 +44,6 @@ def commited():
|
|||||||
]}
|
]}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@fixture
|
@fixture
|
||||||
def full_diff(staged):
|
def full_diff(staged):
|
||||||
return change.create_diff(staged, {})
|
return change.create_diff(staged, {})
|
||||||
|
@ -22,28 +22,34 @@ def host_diff():
|
|||||||
return [
|
return [
|
||||||
[u'add', u'', [
|
[u'add', u'', [
|
||||||
[u'ip', u'10.0.0.3'],
|
[u'ip', u'10.0.0.3'],
|
||||||
[u'hosts_names', ['riak_server1.solar',
|
[u'hosts_names', ['riak_server1.solar', 'riak_server2.solar',
|
||||||
'riak_server2.solar', 'riak_server3.solar']],
|
'riak_server3.solar']],
|
||||||
[u'ssh_user', u'vagrant'],
|
[u'ssh_user', u'vagrant'],
|
||||||
[u'ssh_key', u'/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key'],
|
[u'ssh_key',
|
||||||
]]]
|
u'/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key'],
|
||||||
|
]]
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_details_for_add(host_diff):
|
def test_details_for_add(host_diff):
|
||||||
assert data.details(host_diff) == [
|
assert data.details(host_diff) == [
|
||||||
'++ ip: 10.0.0.3',
|
'++ ip: 10.0.0.3',
|
||||||
"++ hosts_names: ['riak_server1.solar', 'riak_server2.solar', 'riak_server3.solar']",
|
"++ hosts_names: ['riak_server1.solar', 'riak_server2.solar', 'riak_server3.solar']", # NOQA
|
||||||
'++ ssh_user: vagrant', '++ ssh_key: /vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key']
|
'++ ssh_user: vagrant',
|
||||||
|
'++ ssh_key: /vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key' # NOQA
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@fixture
|
@fixture
|
||||||
def list_change():
|
def list_change():
|
||||||
return [[u'change', [u'configs_ports', 0, u'value', 0, u'value'], [18098, 88888]]]
|
return [[u'change', [u'configs_ports', 0, u'value', 0, u'value'], [18098,
|
||||||
|
88888]]]
|
||||||
|
|
||||||
|
|
||||||
def test_list_details_for_change(list_change):
|
def test_list_details_for_change(list_change):
|
||||||
assert data.details(list_change) == [
|
assert data.details(list_change) == [
|
||||||
'-+ configs_ports:[0] : 18098 >> 88888']
|
'-+ configs_ports:[0] : 18098 >> 88888'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@fixture
|
@fixture
|
||||||
|
Loading…
x
Reference in New Issue
Block a user