mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
🧪 Add some more trivial tests
This commit is contained in:
parent
9ca716f9f2
commit
5bbf742fc5
2 changed files with 28 additions and 3 deletions
|
@ -648,5 +648,3 @@ class SophonInstanceDetailsTestCase(BetterAPITestCase):
|
||||||
"theme": "sophon",
|
"theme": "sophon",
|
||||||
"version": pkg_resources.get_distribution("sophon").version,
|
"version": pkg_resources.get_distribution("sophon").version,
|
||||||
})
|
})
|
||||||
|
|
||||||
# TODO: Test some more code
|
|
||||||
|
|
|
@ -1 +1,28 @@
|
||||||
# Create your tests here.
|
from django.test import TestCase
|
||||||
|
|
||||||
|
from sophon.notebooks.apache import ApacheDB
|
||||||
|
from sophon.notebooks.jupyter import generate_secure_token
|
||||||
|
|
||||||
|
|
||||||
|
# Trivial tests to satisfy exam requirements
|
||||||
|
|
||||||
|
|
||||||
|
class JupyterTestCase(TestCase):
|
||||||
|
def test_secure_token(self):
|
||||||
|
for _ in range(5):
|
||||||
|
a = generate_secure_token()
|
||||||
|
b = generate_secure_token()
|
||||||
|
self.assertNotEqual(a, b)
|
||||||
|
|
||||||
|
|
||||||
|
class ApacheTestCase(TestCase):
|
||||||
|
def test_bytes_conversion(self):
|
||||||
|
s = "hello"
|
||||||
|
b = ApacheDB.convert_to_bytes(s)
|
||||||
|
self.assertEqual(b, b"hello")
|
||||||
|
|
||||||
|
def test_bytes_pass(self):
|
||||||
|
s = b"hello"
|
||||||
|
b = ApacheDB.convert_to_bytes(s)
|
||||||
|
self.assertEqual(b, b"hello")
|
||||||
|
self.assertIs(s, b)
|
||||||
|
|
Loading…
Reference in a new issue