This file contains 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
PASS tests/xometry/order.test.js | |
PASS tests/event_handlers/customer_advance.test.js | |
PASS tests/event_handlers/create_sales_order.test.js | |
FAIL tests/event_handlers/create_sales_invoice.test.js | |
● createSalesInvoice › when everything needs to be invoiced | |
expect(received).toMatchSnapshot(hint) | |
Snapshot name: `createSalesInvoice when everything needs to be invoiced: xml for creating sales invoice 1` |
This file contains 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
""" | |
If a sticker is the collection of | |
the letters of "givecampusinc", return the | |
number of stickers needed to complete an input | |
string. "mice span" would require one sticker, | |
"give mice span" would require 2 because | |
the 2nd 'e' requires a new sticker. Treat it as case-insensitive. | |
""" | |
def how_many_sticks(sticker, letters_input): |
This file contains 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
# implemention for (each) loop in python as a function. | |
# Example: | |
# forr([1,2,3], print) | |
# is the same as | |
# for item in container: | |
# print(item) | |
def forr(cont, func): | |
""" forr(cont, func) == for x in cont: func(x) """ |
This file contains 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
from mock import Mock, MagicMock | |
mock = Mock(return_value=1) | |
mock(1, 5, animal='dog') # returns 1 always | |
m = MagicMock(side_effect=ValueError) | |
m(1, 2, 3, 4) # raises valueError | |
m = Mock() | |
attrs = {'mocked_method.return_value': 3, |