This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION calculate_iban(account varchar) | |
| RETURNS varchar AS $$ | |
| DECLARE num numeric; | |
| DECLARE DC varchar(2); | |
| BEGIN | |
| SELECT CAST(replace(account, ' ', '')|| '142800' AS numeric) INTO num; | |
| SELECT LPAD(CAST(98 - MOD(num, 97) AS varchar(2)), 2, '0') INTO DC; | |
| RETURN 'ES' || DC || replace(account, ' ', ''); | |
| END; | |
| $$ LANGUAGE plpgsql; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Testing expected exceptions | |
| >>> from exceptions import UserError | |
| >>> try: | |
| ... someOperation() | |
| ... except UserError as e: | |
| ... e.message | |
| u'ExpectedMessage' | |
| >>> # continue test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test_project.py | |
| ====================================================================== | |
| FAIL: test_0030_create_project_when_user_is_admin (__main__.TestNereidProject) | |
| ---------------------------------------------------------------------- | |
| Traceback (most recent call last): | |
| File "tests/test_project.py", line 341, in test_0030_create_project_when_user_is_admin | |
| response.data | |
| AssertionError: False is not true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var port = 8080, | |
| io = require('socket.io').listen(port); | |
| module.exports = { | |
| "Test socket.io" : function(beforeExit){ | |
| var client = require('socket.io-client').connect( "http://localhost", { port: port }); | |
| client.on('connect', function() { | |
| console.log('connect') | |
| client.disconnect(); |