code stringlengths 3 6.57k |
|---|
pytest.raises(deal.PreContractError) |
func(123) |
func(123) |
test_method_chain_decorator_with_scheme_is_fulfilled(self) |
deal.pre(self.Scheme) |
deal.pre(lambda name: name != 'Oleg') |
func(name) |
func('Chris') |
pytest.raises(deal.PreContractError) |
func(123) |
pytest.raises(deal.PreContractError) |
func('Oleg') |
test_scheme_contract_is_satisfied_when_setting_arg(self) |
deal.inv(self.Scheme) |
User() |
pytest.raises(deal.InvContractError) |
test_scheme_contract_is_satisfied_within_chain(self) |
deal.inv(lambda user: user.name != 'Oleg') |
deal.inv(self.Scheme) |
deal.inv(lambda user: user.name != 'Chris') |
User() |
User() |
pytest.raises(deal.InvContractError) |
User() |
pytest.raises(deal.InvContractError) |
User() |
pytest.raises(deal.InvContractError) |
test_scheme_contract_is_satisfied_when_passing_args(self) |
deal.pre(self.Scheme) |
func(name) |
func('Chris') |
func(name='Chris') |
deal.pre(self.Scheme) |
func(**kwargs) |
func(name='Chris') |
deal.pre(self.Scheme) |
func(name='Max') |
func() |
TestDefaultScheme(MarshmallowSchemeTests) |
setUp(self) |
MyScheme(deal.Scheme) |
is_valid(self) |
isinstance(self.data['name'], str) |
test_raises_expects_function_to_raise_error(self) |
deal.raises(ZeroDivisionError) |
pytest.raises(ZeroDivisionError) |
func(0) |
func(2) |
deal.raises(KeyError) |
pytest.raises(deal.RaisesContractError) |
func(0) |
test_raises_doesnt_override_another_constract(self) |
deal.raises(ZeroDivisionError) |
func(do, number) |
urllib3.PoolManager() |
http.request('GET', 'http://httpbin.org/robots.txt') |
func(False, 1) |
pytest.raises(deal.OfflineContractError) |
func(True, 1) |
pytest.raises(ZeroDivisionError) |
func(False, 0) |
test_network_request_in_offline_raises_exception(self) |
func(do) |
urllib3.PoolManager() |
http.request('GET', 'http://httpbin.org/robots.txt') |
func(False) |
pytest.raises(deal.OfflineContractError) |
func(True) |
test_network_request_in_offline_and_raises_specified_exception(self) |
deal.offline(exception=KeyError) |
func(do) |
urllib3.PoolManager() |
http.request('GET', 'http://httpbin.org/robots.txt') |
func(False) |
pytest.raises(KeyError) |
func(True) |
test_silent_contract_not_allow_print(self) |
func(msg) |
print(msg) |
func(None) |
pytest.raises(deal.SilentContractError) |
func('bad') |
test_chained_contract_decorator(self) |
deal.chain(deal.silent, deal.offline) |
func(msg, do) |
print(msg) |
urllib3.PoolManager() |
http.request('GET', 'http://httpbin.org/robots.txt') |
func(False, False) |
pytest.raises(deal.SilentContractError) |
func(True, False) |
pytest.raises(deal.OfflineContractError) |
func(False, True) |
setUp(self) |
deal.reset() |
tearDown(self) |
deal.reset() |
test_contract_state_switch_custom_param(self) |
deal.pre(lambda x: x > 0, debug=True) |
deal.switch(debug=False) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.