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

DeployTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 8

6 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 2 1
A test_get_yaml() 0 3 1
A setUp() 0 2 1
A test_append_extension() 0 5 2
A test_get_wildcards() 0 3 1
A test_copy_and_replace() 0 6 2
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