summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenshiGenerator.py
blob: 0b74e4a602171d202aab04a0efc89c72d524c2c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import sys
from mock import Mock, MagicMock, patch
from Bcfg2.Server.Plugins.Cfg.CfgEncryptedGenshiGenerator import *

# add all parent testsuite directories to sys.path to allow (most)
# relative imports in python 2.4
path = os.path.dirname(__file__)
while path != "/":
    if os.path.basename(path).lower().startswith("test"):
        sys.path.append(path)
    if os.path.basename(path) == "testsuite":
        break
    path = os.path.dirname(path)
from common import *

from TestServer.TestPlugins.TestCfg.TestCfgGenshiGenerator import \
    TestCfgGenshiGenerator


class TestCfgEncryptedGenshiGenerator(TestCfgGenshiGenerator):
    test_obj = CfgEncryptedGenshiGenerator

    @skipUnless(HAS_CRYPTO, "Encryption libraries not found, skipping")
    def setUp(self):
        TestCfgGenshiGenerator.setUp(self)