Skip to content

Commit

Permalink
Increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h-abdelsalam committed Dec 12, 2023
1 parent ba2ecb3 commit bbd794c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/protocols/gmp/test_context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from gvm.protocols.gmp import Gmp
from gvm.protocols.gmpv208 import Gmp as Gmpv208
from gvm.protocols.gmpv214 import Gmp as Gmpv214
from gvm.protocols.gmpv224 import Gmp as Gmpv224
from gvm.protocols.gmpv225 import Gmp as Gmpv225
from tests.protocols import GmpTestCase


Expand Down Expand Up @@ -84,6 +86,28 @@ def test_select_gmpv214(self):
self.assertEqual(gmp.get_protocol_version(), (21, 4))
self.assertIsInstance(gmp, Gmpv214)

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

with self.gmp as gmp:
self.assertEqual(gmp.get_protocol_version(), (22, 4))
self.assertIsInstance(gmp, Gmpv224)

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

with self.gmp as gmp:
self.assertEqual(gmp.get_protocol_version(), (22, 5))
self.assertIsInstance(gmp, Gmpv225)

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

0 comments on commit bbd794c

Please sign in to comment.