Code Duplication    Length = 39-39 lines in 2 locations

tests/test_all.py 2 locations

@@ 66-104 (lines=39) @@
63
64
        assert os.path.exists(path)
65
66
    def test_data_out(self):
67
        """Verify a sample file is created."""
68
        path = os.path.join(FILES, 'mine-out.yml')
69
70
        if os.path.exists(path):
71
            os.remove(path)
72
73
        data = Data()
74
        yorm.sync(data, path)
75
76
        itunes = Application('itunes')
77
        itunes.versions.mac = ''
78
        itunes.versions.windows = 'iTunes.exe'
79
80
        iphoto = Application('iphoto')
81
        iphoto.versions.mac = 'iPhoto'
82
83
        mac = Computer('macbook', 'Jaces-MacBook', 'AA:BB:CC:DD:EE:FF')
84
        mac2 = Computer('macbook-pro', 'Jaces-MacBook-2', '11:22:33:44:55:66')
85
86
        configuration = ProgramConfig()
87
        configuration.applications = [itunes, iphoto]
88
        configuration.computers = [mac, mac2]
89
90
        data.config = configuration
91
92
        mac_state = State('macbook-pro')
93
        mac_state.timestamp.started = 444
94
95
        itunes_status = Status('itunes')
96
        itunes_status.computers = [mac_state]
97
98
        status = ProgramStatus()
99
        status.applications = [itunes_status]
100
        status.counter = 499
101
102
        data.status = status
103
104
        assert os.path.exists(path)
105
106
    def test_data_in(self):
107
        """Verify a sample file is loaded."""
@@ 26-64 (lines=39) @@
23
class TestFiles:
24
    """Integration tests for creating files."""
25
26
    def test_data(self):
27
        """Verify a sample file is created."""
28
        path = os.path.join(FILES, 'mine.yml')
29
30
        if os.path.exists(path):
31
            os.remove(path)
32
33
        data = Data()
34
        yorm.sync(data, path)
35
36
        itunes = Application('itunes')
37
        itunes.versions.mac = ''
38
        itunes.versions.windows = 'iTunes.exe'
39
40
        iphoto = Application('iphoto')
41
        iphoto.versions.mac = 'iPhoto'
42
43
        mac = Computer('macbook', 'Other.local')
44
        mac2 = Computer('macbook-pro')
45
46
        configuration = ProgramConfig()
47
        configuration.applications = [itunes, iphoto]
48
        configuration.computers = [mac, mac2]
49
50
        data.config = configuration
51
52
        mac_state = State('macbook-pro')
53
        mac_state.timestamp.started = 444
54
55
        itunes_status = Status('itunes')
56
        itunes_status.computers = [mac_state]
57
58
        status = ProgramStatus()
59
        status.applications = [itunes_status]
60
        status.counter = 499
61
62
        data.status = status
63
64
        assert os.path.exists(path)
65
66
    def test_data_out(self):
67
        """Verify a sample file is created."""