Jean-Paul Calderone | a566e4e | 2014-03-25 21:01:10 -0400 | [diff] [blame] | 1 | # Copyright (C) Jean-Paul Calderone |
| 2 | # See LICENSE for details. |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 3 | |
| 4 | """ |
Alex Chan | deec934 | 2016-12-19 22:00:38 +0000 | [diff] [blame] | 5 | Unit tests for `OpenSSL.tsafe`. |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 6 | """ |
| 7 | |
Jean-Paul Calderone | a566e4e | 2014-03-25 21:01:10 -0400 | [diff] [blame] | 8 | from OpenSSL.SSL import TLSv1_METHOD, Context |
| 9 | from OpenSSL.tsafe import Connection |
Hynek Schlawack | f0e6685 | 2015-10-16 20:18:38 +0200 | [diff] [blame] | 10 | |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 11 | |
Alex Chan | deec934 | 2016-12-19 22:00:38 +0000 | [diff] [blame] | 12 | class TestConnection(object): |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 13 | """ |
Alex Chan | deec934 | 2016-12-19 22:00:38 +0000 | [diff] [blame] | 14 | Tests for `OpenSSL.tsafe.Connection`. |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 15 | """ |
Jean-Paul Calderone | a566e4e | 2014-03-25 21:01:10 -0400 | [diff] [blame] | 16 | def test_instantiation(self): |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 17 | """ |
Alex Chan | deec934 | 2016-12-19 22:00:38 +0000 | [diff] [blame] | 18 | `OpenSSL.tsafe.Connection` can be instantiated. |
Jean-Paul Calderone | 65627a2 | 2014-03-25 20:58:30 -0400 | [diff] [blame] | 19 | """ |
Jean-Paul Calderone | a566e4e | 2014-03-25 21:01:10 -0400 | [diff] [blame] | 20 | # The following line should not throw an error. This isn't an ideal |
| 21 | # test. It would be great to refactor the other Connection tests so |
| 22 | # they could automatically be applied to this class too. |
Jean-Paul Calderone | 5bfdea3 | 2014-03-25 21:01:53 -0400 | [diff] [blame] | 23 | Connection(Context(TLSv1_METHOD), None) |