work on blocks tests

This commit is contained in:
Kevin Froman 2019-09-10 17:35:44 -05:00
parent 63b32f98df
commit a50abcd20a

View File

@ -8,11 +8,17 @@ TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
os.environ["ONIONR_HOME"] = TEST_DIR
import onionrblocks
import onionrstorage
from utils import createdirs
from onionrutils import bytesconverter
createdirs.create_dirs()
class OnionrBlockTests(unittest.TestCase):
def test_plaintext_insert(self):
message = 'hello world'
onionrblocks.insert(message)
bl = onionrblocks.insert(message)
self.assertIn(bytesconverter.str_to_bytes(message), onionrstorage.getData(bl))
#def test_encrypted_insert(self):
# key_pair_1 = nacl.signing.SigningKey.generate(encoder=nacl.encoding.base32)
unittest.main()