class TestEncryptionStateStore(unittest.TestCase):
    def setUp(self):
        self.conn = sqlite3.connect('test-db', check_same_thread=False)
        self.e = EncryptionState(self.conn)

    def test_create(self):
        self.assertEquals(self.e.is_active('*****@*****.**'), False)

    def test_enable_encryption(self):
        self.e.activate('*****@*****.**')
        self.assertEquals(self.e.is_active('*****@*****.**'), True)

    def test_disable_encryption(self):
        self.e.activate('*****@*****.**')
        self.assertEquals(self.e.is_active('*****@*****.**'), True)
        self.e.deactivate('*****@*****.**')
        self.assertEquals(self.e.is_active('*****@*****.**'), False)

    def tearDown(self):
        os.remove('test-db')
Exemplo n.º 2
0
class TestEncryptionStateStore(unittest.TestCase):

    def setUp(self):
        self.conn = sqlite3.connect('test-db', check_same_thread=False)
        self.e = EncryptionState(self.conn)

    def test_create(self):
        self.assertEquals(self.e.is_active('*****@*****.**'), False)

    def test_enable_encryption(self):
        self.e.activate('*****@*****.**')
        self.assertEquals(self.e.is_active('*****@*****.**'), True)

    def test_disable_encryption(self):
        self.e.activate('*****@*****.**')
        self.assertEquals(self.e.is_active('*****@*****.**'), True)
        self.e.deactivate('*****@*****.**')
        self.assertEquals(self.e.is_active('*****@*****.**'), False)

    def tearDown(self):
        os.remove('test-db')
 def setUp(self):
     self.conn = sqlite3.connect('test-db', check_same_thread=False)
     self.e = EncryptionState(self.conn)
Exemplo n.º 4
0
 def setUp(self):
     self.conn = sqlite3.connect('test-db', check_same_thread=False)
     self.e = EncryptionState(self.conn)