Completed
Pull Request — master (#694)
by Eric
02:14
created

TestSerializationAcceptance   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 20
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_custom_serializer() 0 7 2
A _repo_id() 0 2 1
A test_cross_hooks_context() 0 7 2
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
"""
5
test_real_hooks_acceptance
6
--------------------------
7
8
Additional tests for `cookiecutter.hooks` module.
9
"""
10
11
import os
12
13
from .support import AbstractAcceptanceTest
14
15
16
class TestSerializationAcceptance(AbstractAcceptanceTest):
17
18
    def _repo_id(self):
19
        return 'test-serialization-acceptance'
20
21
    def test_cross_hooks_context(self):
22
        """
23
        context can be updated from a hook to another
24
        """
25
        template = 'crosshooks'
26
        self.run(template)
27
        assert os.path.exists(os.path.join(self.project_dir, template))
28
29
    def test_custom_serializer(self):
30
        """
31
        context can be updated from a hook to another
32
        """
33
        template = 'custom_serializer'
34
        self.run(template)
35
        assert os.path.exists(os.path.join(self.project_dir, 'COPY'))
36