|
11 | 11 | from gvm.protocols.gmp._gmp224 import GMPv224
|
12 | 12 | from gvm.protocols.gmp._gmp225 import GMPv225
|
13 | 13 | from gvm.protocols.gmp._gmp226 import GMPv226
|
| 14 | +from gvm.protocols.gmp._gmp227 import GMPv227 |
14 | 15 | from tests.protocols import GmpTestCase
|
15 | 16 |
|
16 | 17 |
|
@@ -133,6 +134,49 @@ def test_select_gmpv226(self):
|
133 | 134 | self.assertEqual(gmp.get_protocol_version(), (22, 6))
|
134 | 135 | self.assertIsInstance(gmp, GMPv226)
|
135 | 136 |
|
| 137 | + def test_select_gmpv227(self): |
| 138 | + self.connection.read.return_value( |
| 139 | + b'<get_version_response status="200" status_text="OK">' |
| 140 | + b"<version>22.07</version>" |
| 141 | + b"</get_version_response>" |
| 142 | + ) |
| 143 | + |
| 144 | + with self.gmp as gmp: |
| 145 | + self.assertEqual(gmp.get_protocol_version(), (22, 7)) |
| 146 | + self.assertIsInstance(gmp, GMPv227) |
| 147 | + |
| 148 | + self.connection.read.return_value( |
| 149 | + b'<get_version_response status="200" status_text="OK">' |
| 150 | + b"<version>22.7</version>" |
| 151 | + b"</get_version_response>" |
| 152 | + ) |
| 153 | + |
| 154 | + with self.gmp as gmp: |
| 155 | + self.assertEqual(gmp.get_protocol_version(), (22, 7)) |
| 156 | + self.assertIsInstance(gmp, GMPv227) |
| 157 | + |
| 158 | + def test_next_version_fallback(self): |
| 159 | + self.connection.read.return_value( |
| 160 | + b'<get_version_response status="200" status_text="OK">' |
| 161 | + b"<version>22.8</version>" |
| 162 | + b"</get_version_response>" |
| 163 | + ) |
| 164 | + |
| 165 | + with self.gmp as gmp: |
| 166 | + self.assertEqual(gmp.get_protocol_version(), (22, 7)) |
| 167 | + self.assertIsInstance(gmp, GMPv227) |
| 168 | + |
| 169 | + def test_newer_version_fallback(self): |
| 170 | + self.connection.read.return_value( |
| 171 | + b'<get_version_response status="200" status_text="OK">' |
| 172 | + b"<version>22.20</version>" |
| 173 | + b"</get_version_response>" |
| 174 | + ) |
| 175 | + |
| 176 | + with self.gmp as gmp: |
| 177 | + self.assertEqual(gmp.get_protocol_version(), (22, 7)) |
| 178 | + self.assertIsInstance(gmp, GMPv227) |
| 179 | + |
136 | 180 | def test_unknown_protocol(self):
|
137 | 181 | self.connection.read.return_value(
|
138 | 182 | b'<get_version_response status="200" status_text="OK">'
|
|
0 commit comments