Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
12cda74
[LIB-837][WIP] working on custom sockets in LIB
opalczynski Aug 10, 2016
460006f
[LIB-837] Add missing docs about custom_sockets; move utils to anothe…
opalczynski Aug 11, 2016
5eca906
[LIB-837] add missing fields in doc string;
opalczynski Aug 11, 2016
c0f75cb
[LIB-837] correct documentation; add possibility to read all endpoint…
opalczynski Aug 12, 2016
e108b5a
[LIB-837] Correct after tests;
opalczynski Aug 12, 2016
5eab464
[LIB-837] another portion of corrects;
opalczynski Aug 12, 2016
1afcd9f
[LIB-837] correct tests again;
opalczynski Aug 12, 2016
48eb08e
[LIB-837] change tests instead of doing a magic in ModelField;
opalczynski Aug 12, 2016
4e2ee33
Language updates
MariuszWisniewski Aug 12, 2016
fe52e7a
[ci skip] readme
MariuszWisniewski Aug 12, 2016
7bc974a
[ci skip] Endpoints readme update
MariuszWisniewski Aug 15, 2016
bc71ad1
[LIB-837] revert ModelField on script in script endpoint model;
opalczynski Aug 16, 2016
327a3fc
[LIB-837] correct data passing on run methods;
opalczynski Aug 16, 2016
d50344b
[LIB-837] correct custom socket behaviour;
opalczynski Aug 16, 2016
c2ffd3a
Merge branch 'LIB-837' of github.com:Syncano/syncano-python into LIB-837
opalczynski Aug 16, 2016
42e4373
[LIB-837] corrects after qa;
opalczynski Aug 16, 2016
04c5ef6
[LIB-837] corrects after qa;
opalczynski Aug 16, 2016
9f5adba
[LIB-837] correct docs examples, polish the tests;
opalczynski Aug 16, 2016
69f3a11
[LIB-837] remove default custom socket in setupclass;
opalczynski Aug 16, 2016
3d1f4dd
[LIB-837] remove default custom socket in setupclass;
opalczynski Aug 16, 2016
d982fd0
[LIB-837] final test correction;
opalczynski Aug 16, 2016
8662e42
Update language
devintyler Aug 16, 2016
0864163
[LIB-837] add possibility to directly point instance name when gettin…
opalczynski Aug 18, 2016
9246b98
[LIB-837] change interface: publish to install in custom socket context;
opalczynski Aug 19, 2016
31c51b9
Merge branch 'LIB-837' of github.com:Syncano/syncano-python into LIB-837
opalczynski Aug 19, 2016
14f6ff7
[LIB-837] add status badges to README
opalczynski Aug 19, 2016
2372986
[LIB-837] small changes after CORE change;
opalczynski Aug 22, 2016
515e50b
[LIB-837] correct SocketEndpoint behaviour (run mainly);
opalczynski Aug 22, 2016
16795dd
[LIB-837] correct run in CustomSocket;
opalczynski Aug 22, 2016
b8c252f
[LIB-837] add possiblity to install from url;
opalczynski Aug 23, 2016
3cf2465
[LIB-837] update documentation for installing socket from url;
opalczynski Aug 23, 2016
ef39be6
[LIB-837] fixes after qa;
opalczynski Aug 24, 2016
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
Prev Previous commit
Next Next commit
[LIB-837] another portion of corrects;
  • Loading branch information
opalczynski committed Aug 12, 2016
commit 5eab4640a047792885b26cd8223fe975f464f290
4 changes: 3 additions & 1 deletion syncano/models/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ def to_native(self, value):

class ModelField(Field):

read_only = False

def __init__(self, rel, *args, **kwargs):
self.rel = rel
self.just_pk = kwargs.pop('just_pk', True)
Expand Down Expand Up @@ -508,7 +510,7 @@ def validate(self, value, model_instance):
if not isinstance(value, (self.rel, dict)) and not self.is_data_object_mixin:
raise self.ValidationError('Value needs to be a {0} instance.'.format(self.rel.__name__))

if (self.required and isinstance(value, self.rel))or \
if (self.required and isinstance(value, self.rel)) or \
(self.is_data_object_mixin and hasattr(value, 'validate')):
value.validate()

Expand Down
8 changes: 5 additions & 3 deletions tests/integration_test_custom_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

class CustomSocketTest(InstanceMixin, IntegrationTest):

def setUp(self):
self.custom_socket = self._create_custom_socket('default', self._define_dependencies_new_script_endpoint)
@classmethod
def setUpClass(cls):
super(CustomSocketTest, cls).setUpClass()
cls.custom_socket = cls._create_custom_socket('default', cls._define_dependencies_new_script_endpoint)

def test_publish_custom_socket(self):
# this test new ScriptEndpoint dependency create;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests

Expand Down Expand Up @@ -42,7 +44,7 @@ def test_creating_raw_data(self):
]
)

self.assertTrue(custom_socket.id)
self.assertTrue(custom_socket.name)

def test_custom_socket_run(self):
results = self.custom_socket.run('GET', 'my_endpoint_default')
Expand Down