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
| # Old version: | |
| >>> from mock import MagicMock | |
| >>> a = MagicMock() | |
| >>> a.foo("hello") | |
| <mock.MagicMock object at 0xa40cecc> | |
| >>> a.foo("goodbye") | |
| <mock.MagicMock object at 0xa40cecc> | |
| >>> a.foo.call_args_list | |
| [(('hello',), {}), (('goodbye',), {})] | |
| >>> a.foo.call_args_list[0] |
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
| ''' | |
| Created on Apr 14, 2011 | |
| ''' | |
| class LCDCalculator(object): | |
| def calc(self, num1, num2): | |
| return reduce(lambda x, y: x * y, self.smart_union(self.factorize(num1), self.factorize(num2))) | |
| def factorize(self, num): |
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
| public interface ConditionTester { | |
| boolean isTrue(); | |
| } | |
| public static void delayedAssert(ConditionTester tester, | |
| long timeout, | |
| long pollingInterval) | |
| throws InterruptedException { | |
| long startTime = System.currentTimeMillis(); |
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
| #include <iostream> | |
| using namespace std; | |
| void main() | |
| { | |
| int a = 1, b = 2; | |
| int arr[] = {1, 3, 5, a, b}; | |
| int *p = arr + 1; | |
| int **q = &p; | |
| int ***crazy = new int**[*(arr + 4)]; |
NewerOlder