add case [in]sensitivity tests + add OfficialProvider model

`ci` in this context means "Case Insensitive".
`cs` in this context means "Case Sensitive".

New models created:
    - OfficialProvider
      This was required to write a test for checking that
      OfficialProviders behaves as we expect, which was the starter
      for the original aurblup bug.

New tests created:
    - test_official_provider

Modified tests:
    - test_package_base: add ci test
    - test_package: add ci test
    - test_session: add cs test
    - test_ssh_pub_key: add cs test

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-05 18:13:10 -07:00
parent e865a6347f
commit 1874e821f5
6 changed files with 167 additions and 0 deletions

View file

@ -41,6 +41,18 @@ def test_ssh_pub_key():
assert ssh_pub_key.PubKey == "testPubKey"
def test_ssh_pub_key_cs():
""" Test case sensitivity of the database table. """
ssh_pub_key_cs = create(SSHPubKey, UserID=user.ID,
Fingerprint="TESTFINGERPRINT",
PubKey="TESTPUBKEY")
assert ssh_pub_key_cs.Fingerprint == "TESTFINGERPRINT"
assert ssh_pub_key_cs.PubKey == "TESTPUBKEY"
assert ssh_pub_key.Fingerprint == "testFingerprint"
assert ssh_pub_key.PubKey == "testPubKey"
def test_ssh_pub_key_fingerprint():
assert get_fingerprint(TEST_SSH_PUBKEY) is not None