GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit c6cfd912 authored by Cecylia Bocovich's avatar Cecylia Bocovich

Add database tests

parent dac0ab62
......@@ -5,6 +5,7 @@ from __future__ import unicode_literals
from gettor.utils import options
from gettor.utils import strings
from gettor.utils import twitter
from gettor.utils.db import SQLite3
from gettor.services.email.sendmail import Sendmail
from gettor.services.twitter import twitterdm
from gettor.parse.email import EmailParser, AddressError, DKIMError
......
#!/usr/bin/env python3
import pytest
import pytest_twisted
from twisted.trial import unittest
from twisted.internet import defer, reactor
from twisted.internet import task
from . import conftests
class DatabaseTests(unittest.TestCase):
# Fail any tests which take longer than 15 seconds.
timeout = 15
def setUp(self):
self.settings = conftests.options.parse_settings("en","./gettor.conf.json")
self.locales = conftests.strings.get_locales()
self.conn = conftests.SQLite3(self.settings.get("dbname"))
def tearDown(self):
print("tearDown()")
return self.conn.dbpool.close()
@pytest_twisted.inlineCallbacks
def test_stored_locales(self):
locales = yield self.conn.get_locales()
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment