2015-06-02 09:55:16 -04:00
|
|
|
"""Tests for letsencrypt_apache.obj."""
|
2014-12-19 18:49:29 -05:00
|
|
|
import unittest
|
|
|
|
|
|
2015-06-02 09:55:16 -04:00
|
|
|
from letsencrypt.plugins import common
|
2014-12-19 18:49:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class VirtualHostTest(unittest.TestCase):
|
|
|
|
|
"""Test the VirtualHost class."""
|
2015-06-02 09:55:16 -04:00
|
|
|
|
2014-12-19 18:49:29 -05:00
|
|
|
def setUp(self):
|
2015-05-10 06:47:58 -04:00
|
|
|
from letsencrypt_apache.obj import VirtualHost
|
2015-01-10 01:25:36 -05:00
|
|
|
self.vhost1 = VirtualHost(
|
2014-12-19 18:49:29 -05:00
|
|
|
"filep", "vh_path",
|
2015-06-02 09:55:16 -04:00
|
|
|
set([common.Addr.fromstring("localhost")]), False, False)
|
2014-12-19 18:49:29 -05:00
|
|
|
|
|
|
|
|
def test_eq(self):
|
2015-05-10 06:47:58 -04:00
|
|
|
from letsencrypt_apache.obj import VirtualHost
|
2015-01-10 01:25:36 -05:00
|
|
|
vhost1b = VirtualHost(
|
2014-12-19 18:49:29 -05:00
|
|
|
"filep", "vh_path",
|
2015-06-02 09:55:16 -04:00
|
|
|
set([common.Addr.fromstring("localhost")]), False, False)
|
2014-12-19 18:49:29 -05:00
|
|
|
|
|
|
|
|
self.assertEqual(vhost1b, self.vhost1)
|
|
|
|
|
self.assertEqual(str(vhost1b), str(self.vhost1))
|
2015-02-12 18:21:35 -05:00
|
|
|
self.assertFalse(vhost1b == 1234)
|
2015-02-02 13:47:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2015-05-10 13:34:25 -04:00
|
|
|
unittest.main() # pragma: no cover
|