diff --git a/beat/web/algorithms/tests/tests_api.py b/beat/web/algorithms/tests/tests_api.py index 7c7ada18325a898c6a8c6874b542ee4cff1492ce..3c68aa8f43bb226cd06b5f0385f417d77ef4d926 100755 --- a/beat/web/algorithms/tests/tests_api.py +++ b/beat/web/algorithms/tests/tests_api.py @@ -684,7 +684,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "valid-name1", "description": "blah"}), + json.dumps({"name": "valid-name1", "version": 1, "description": "blah"}), content_type="application/json", ) @@ -710,7 +710,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "valid-name1"}), + json.dumps({"name": "valid-name1", "version": 1}), content_type="application/json", ) @@ -735,7 +735,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "invalid name1", "description": "blah"}), + json.dumps({"name": "invalid name1", "version": 1, "description": "blah"}), content_type="application/json", ) @@ -761,7 +761,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "invalid name1"}), + json.dumps({"name": "invalid name1", "version": 1}), content_type="application/json", ) @@ -789,6 +789,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "valid-name1", + "version": 1, "description": "blah", "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, @@ -824,6 +825,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "valid-name1", + "version": 1, "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, } @@ -857,6 +859,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "invalid name1", + "version": 1, "description": "blah", "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, @@ -892,6 +895,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "invalid name1", + "version": 1, "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, } @@ -922,7 +926,9 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "usable_by_one_user", "description": "blah"}), + json.dumps( + {"name": "usable_by_one_user", "version": 1, "description": "blah"} + ), content_type="application/json", ) @@ -933,7 +939,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "usable_by_one_user"}), + json.dumps({"name": "usable_by_one_user", "version": 1}), content_type="application/json", ) @@ -944,7 +950,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "algorithm 4", "description": "blah"}), + json.dumps({"name": "algorithm 4", "version": 1, "description": "blah"}), content_type="application/json", ) @@ -955,7 +961,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): response = self.client.post( self.url, - json.dumps({"name": "algorithm 4"}), + json.dumps({"name": "algorithm 4", "version": 1}), content_type="application/json", ) @@ -969,6 +975,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "usable_by_one_user", + "version": 1, "description": "blah", "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, @@ -987,6 +994,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "usable_by_one_user", + "version": 1, "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, } @@ -1004,6 +1012,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "algorithm 4", + "version": 1, "description": "blah", "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, @@ -1022,6 +1031,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "algorithm 4", + "version": 1, "declaration": AlgorithmsAPIBase.DECLARATION, "code": AlgorithmsAPIBase.CODE, } @@ -1039,6 +1049,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "valid-name1", + "version": 1, "description": "blah", "declaration": AlgorithmsAPIBase.CXX_DECLARATION, } @@ -1085,6 +1096,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "valid-name1", + "version": 1, "description": "blah", "declaration": AlgorithmsAPIBase.CXX_DECLARATION, "fork_of": "jackdoe/binary_personal/1", @@ -1124,6 +1136,7 @@ class AlgorithmCreation(AlgorithmsAPIBase): json.dumps( { "name": "binary_personal", + "version": 2, "description": "blah", "declaration": AlgorithmsAPIBase.CXX_DECLARATION, "previous_version": "jackdoe/binary_personal/1",