Completed
Push — master ( 8d23ab...fd6a33 )
by
unknown
02:48
created

DeployTest.test_get_yaml()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
# -*- coding: utf-8 -*-
2
import unittest
3
from oe_utils.deploy import *
4
5
6
class DeployTest(unittest.TestCase):
7
8
    def setUp(self):
9
        pass
10
11
    def tearDown(self):
12
        pass
13
14
    def test_get_yaml(self):
15
        res = get_yaml('fixtures/wildcards.yaml')
16
        self.assertEqual({'variables': {'variabele': {'correct': 'True'}}}, res)
17
18
    def test_get_wildcards(self):
19
        res = get_wildcards('fixtures/wildcards.yaml')
20
        self.assertIn(('correct', 'True'), res)
21
22
    def test_copy_and_replace(self):
23
        mapping = get_wildcards('fixtures/wildcards.yaml')
24
        copy_and_replace('fixtures/input.ini', 'fixtures/output.ini', mapping)
25
        with open('fixtures/output.ini', "r") as in_file:
26
            res = in_file.readlines()
27
        self.assertIn('correct = True', res)
28
29
    def test_append_extension(self):
30
        append_extension('fixtures/output.ini','fixtures/outputext.ini', 'een test toevoeging')
31
        with open('fixtures/outputext.ini', "r") as in_file:
32
            res = in_file.readlines()
33
        self.assertIn('een test toevoeging\n', res)
34