Пример #1
0
def positive(element, scheme):
    assert not isitbullshit(element, scheme)

    IsItBullshitMixin.assertNotBullshit(element, scheme)
    with pytest.raises(AssertionError):
        IsItBullshitMixin.assertBullshit(element, scheme)
    raise_for_problem(element, scheme)
Пример #2
0
def positive(element, scheme):
    assert not isitbullshit(element, scheme)

    IsItBullshitMixin.assertNotBullshit(element, scheme)
    with pytest.raises(AssertionError):
        IsItBullshitMixin.assertBullshit(element, scheme)
    raise_for_problem(element, scheme)
Пример #3
0
def negative(element, scheme):
    assert isitbullshit(element, scheme)

    IsItBullshitMixin.assertBullshit(element, scheme)
    with pytest.raises(AssertionError):
        IsItBullshitMixin.assertNotBullshit(element, scheme)
    with pytest.raises(ItIsBullshitError):
        raise_for_problem(element, scheme)
Пример #4
0
def negative(element, scheme):
    assert isitbullshit(element, scheme)

    IsItBullshitMixin.assertBullshit(element, scheme)
    with pytest.raises(AssertionError):
        IsItBullshitMixin.assertNotBullshit(element, scheme)
    with pytest.raises(ItIsBullshitError):
        raise_for_problem(element, scheme)
Пример #5
0
    def test_orskipped2(self):
        schema = {"foo": 1, "bar": OrSkipped(int), "baz": OrSkipped(str)}

        positive(schema, schema)

        stripped_schema = dict(
            (k, v) for k, v in iteritems(schema) if k != "baz")
        positive(schema, stripped_schema)
        raise_for_problem(stripped_schema, schema)
Пример #6
0
    def test_orskipped2(self):
        schema = {
            "foo": 1,
            "bar": OrSkipped(int),
            "baz": OrSkipped(str)
        }

        positive(schema, schema)

        stripped_schema = dict(
            (k, v) for k, v in iteritems(schema) if k != "baz"
        )
        positive(schema, stripped_schema)
        raise_for_problem(stripped_schema, schema)