PHP 8.5.2
Preview: ExampleWithAssertThat.py Size: 553 B
/usr/share/doc/python3-hamcrest/examples/ExampleWithAssertThat.py

import sys

sys.path.append("..")

from hamcrest import *
import unittest


class ExampleWithAssertThat(unittest.TestCase):
    def testUsingAssertThat(self):
        assert_that("xx", is_("xx"))
        assert_that("yy", is_not("xx"))
        assert_that("i like cheese", contains_string("cheese"))

    def testCanAlsoSupplyDescriptiveReason(self):
        assert_that("xx", is_("xx"), "description")

    def testCanAlsoAssertPlainBooleans(self):
        assert_that(True, "This had better not fail")


if __name__ == "__main__":
    unittest.main()

Directory Contents

Dirs: 0 × Files: 2

Name Size Perms Modified Actions
1.62 KB lrw-r--r-- 2023-10-22 15:43:13
Edit Download
553 B lrw-r--r-- 2023-10-22 15:43:13
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).