How to use the check50.check function in check50

To help you get started, we’ve selected a few check50 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cs50 / check50 / tests / checks / stdin_multiline / check.py View on Github external
@check50.check()
def prints_hello_name_non_chaining():
    """prints hello name (non chaining)"""
    check50.run("python3 foo.py").stdin("bar\nbaz").stdout("hello bar").stdout("hello baz")
github cs50 / check50 / tests / checks / stdin_multiline / check.py View on Github external
@check50.check()
def prints_hello_name_non_chaining_prompt():
    """prints hello name (non chaining) (prompt)"""
    check50.run("python3 foo.py").stdin("bar\nbaz", prompt=True).stdout("hello bar").stdout("hello baz")
github cs50 / check50 / tests / checks / hidden / __init__.py View on Github external
@check50.check()
@check50.hidden("foo")
def check():
    check50.log("AHHHHHHHHHHHHHHHHHHH")
    raise check50.Failure("AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH")
github cs50 / check50 / checks / cs50 / 2017 / x / finance / checks.py View on Github external
    @check()
    def exists(self):
        """application.c exists."""
        super(Finance, self).exists("application.py")
github cs50 / check50 / demo / hello / check50 / __init__.py View on Github external
@check50.check(compiles)
def valgrind_hello():
    """valgrinding "hello, world\\n" """
    check50.c.valgrind("./hello").stdin("david").stdout("[H|h]ello, david!?")
github cs50 / check50 / demo / hello / check50 / __init__.py View on Github external
@check50.check()
def exists():
    """hello.c exists"""
    check50.exists("hello.c")
github cs50 / check50 / checks / cs50 / 2017 / x / mario / more / checks.py View on Github external
    @check("compiles")
    def test_reject_foo(self):
        """rejects a non-numeric height of "foo" """
        self.spawn("./mario").stdin("foo").reject()
github cs50 / check50 / checks / cs50 / 2017 / x / mario / more / checks.py View on Github external
    @check()
    def exists(self):
        """mario.c exists."""
        super(MarioMore, self).exists("mario.c")
        self.include("0.txt", "1.txt", "2.txt", "23.txt")
github cs50 / check50 / checks / cs50 / 2017 / x / mario / more / checks.py View on Github external
    @check("compiles")
    def test_reject_empty(self):
        """rejects a non-numeric height of "" """
        self.spawn("./mario").stdin("").reject()