test_apostrophe_is_escaped_by_doubling

Tests › tests/test_vocabulary.py

passed Passed in the packaged run.

What this test is for

Why it exists

`repr` quotes an apostrophe-bearing value with DOUBLE quotes, which SQLite reads as an identifier, not a string. No shipped value contains one today; the generator must not be the reason it can never be added.

Given

  1. vocab = Vocabulary(id="t", values=("it's", "plain"), means="test")
  2. conn = sqlite3.connect(":memory:")
2 more
  1. conn.execute(f"CREATE TABLE t (c TEXT {vocab.check('c')})")
  2. conn.execute('INSERT INTO t VALUES ("it\'s")')
→

When

  1. conn.execute("INSERT INTO t VALUES ('nope')")
  2. conn.close()
→

Then

  1. ✓ vocab.check("c") equals "CHECK(c IN ('it''s', 'plain'))"
  2. ✓ raises sqlite3.IntegrityError

tests/test_vocabulary.py:332 · its file's page

What it checks (1)

  1. assert vocab.check("c") == "CHECK(c IN ('it''s', 'plain'))" not attributed

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

Also reaches 1 requirement

Its run touches their code; that is reach, not proof.