Code Duplication    Length = 32-32 lines in 2 locations

tests/test_aprs.py 2 locations

@@ 119-150 (lines=32) @@
116
            """
117
            Tests authenticating against APRS-IS using an invalid call+pass.
118
            """
119
            httpretty.HTTPretty.register_uri(
120
                httpretty.HTTPretty.POST,
121
                self.fake_server,
122
                status=401
123
            )
124
125
            aprs_conn = apex.aprs.aprs_internet_service.AprsInternetService(
126
                user=self.fake_callsign,
127
                input_url=self.fake_server
128
            )
129
            aprs_conn.connect()
130
131
            msg = {
132
                'source': self.fake_callsign,
133
                'destination': 'APRS',
134
                'path': ['TCPIP*'],
135
                'text': '=3745.00N/12227.00W-Simulated Location'
136
            }
137
            self.logger.debug(locals())
138
139
            result = aprs_conn.send(msg, protocol='HTTP')
140
141
            self.assertFalse(result)
142
143
        @unittest.skip('Test only works with real server.')
144
        def test_more(self):
145
            """
146
            Tests APRS-IS binding against a real APRS-IS server.
147
            """
148
            aprs_conn = apex.aprs.aprs_internet_service.AprsInternetService(
149
                user=self.real_callsign,
150
                input_url=self.real_server
151
            )
152
            aprs_conn.connect()
153
@@ 86-117 (lines=32) @@
83
84
    if sys.version_info < (3, 0):
85
        @httpretty.httprettified
86
        def test_fake_good_auth(self):
87
            """
88
            Tests authenticating against APRS-IS using a valid call+pass.
89
            """
90
            httpretty.HTTPretty.register_uri(
91
                httpretty.HTTPretty.POST,
92
                self.fake_server,
93
                status=204
94
            )
95
96
            aprs_conn = apex.aprs.aprs_internet_service.AprsInternetService(
97
                user=self.fake_callsign,
98
                input_url=self.fake_server
99
            )
100
            aprs_conn.connect()
101
102
            msg = {
103
                'source': self.fake_callsign,
104
                'destination': 'APRS',
105
                'path': ['TCPIP*'],
106
                'text': '=3745.00N/12227.00W-Simulated Location'
107
            }
108
            self.logger.debug(locals())
109
110
            result = aprs_conn.send(msg)
111
112
            self.assertTrue(result)
113
114
        @httpretty.httprettified
115
        def test_fake_bad_auth_http(self):
116
            """
117
            Tests authenticating against APRS-IS using an invalid call+pass.
118
            """
119
            httpretty.HTTPretty.register_uri(
120
                httpretty.HTTPretty.POST,