Skip to content

Commit

Permalink
Added test case for gmpv9 selection
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Dec 8, 2019
1 parent cb99518 commit e63fcc5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/protocols/gmp/test_context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from gvm.protocols.gmp import Gmp
from gvm.protocols.gmpv7 import Gmp as Gmpv7
from gvm.protocols.gmpv8 import Gmp as Gmpv8
from gvm.protocols.gmpv9 import Gmp as Gmpv9


class GmpContextManagerTestCase(GmpTestCase):
Expand Down Expand Up @@ -53,6 +54,17 @@ def test_select_gmpv8(self):
self.assertEqual(gmp.get_protocol_version(), (8,))
self.assertIsInstance(gmp, Gmpv8)

def test_select_gmpv9(self):
self.connection.read.return_value(
'<get_version_response status="200" status_text="OK">'
'<version>9.0</version>'
'</get_version_response>'
)

with self.gmp as gmp:
self.assertEqual(gmp.get_protocol_version(), (9,))
self.assertIsInstance(gmp, Gmpv9)

def test_unknown_protocol(self):
self.connection.read.return_value(
'<get_version_response status="200" status_text="OK">'
Expand Down

0 comments on commit e63fcc5

Please sign in to comment.