| @@ 22-74 (lines=53) @@ | ||
| 19 | import unittest |
|
| 20 | ||
| 21 | ||
| 22 | class GmpGetPortListsTestCase: |
|
| 23 | def test_get_port_lists(self): |
|
| 24 | self.gmp.get_port_lists() |
|
| 25 | ||
| 26 | self.connection.send.has_been_called_with('<get_port_lists/>') |
|
| 27 | ||
| 28 | def test_get_port_lists_with_filter(self): |
|
| 29 | self.gmp.get_port_lists(filter='foo=bar') |
|
| 30 | ||
| 31 | self.connection.send.has_been_called_with( |
|
| 32 | '<get_port_lists filter="foo=bar"/>' |
|
| 33 | ) |
|
| 34 | ||
| 35 | def test_get_port_lists_with_filter_id(self): |
|
| 36 | self.gmp.get_port_lists(filter_id='f1') |
|
| 37 | ||
| 38 | self.connection.send.has_been_called_with( |
|
| 39 | '<get_port_lists filt_id="f1"/>' |
|
| 40 | ) |
|
| 41 | ||
| 42 | def test_get_port_lists_with_trash(self): |
|
| 43 | self.gmp.get_port_lists(trash=True) |
|
| 44 | ||
| 45 | self.connection.send.has_been_called_with('<get_port_lists trash="1"/>') |
|
| 46 | ||
| 47 | self.gmp.get_port_lists(trash=False) |
|
| 48 | ||
| 49 | self.connection.send.has_been_called_with('<get_port_lists trash="0"/>') |
|
| 50 | ||
| 51 | def test_get_port_lists_with_details(self): |
|
| 52 | self.gmp.get_port_lists(details=True) |
|
| 53 | ||
| 54 | self.connection.send.has_been_called_with( |
|
| 55 | '<get_port_lists details="1"/>' |
|
| 56 | ) |
|
| 57 | ||
| 58 | self.gmp.get_port_lists(details=False) |
|
| 59 | ||
| 60 | self.connection.send.has_been_called_with( |
|
| 61 | '<get_port_lists details="0"/>' |
|
| 62 | ) |
|
| 63 | ||
| 64 | def test_get_port_lists_with_targets(self): |
|
| 65 | self.gmp.get_port_lists(targets=True) |
|
| 66 | ||
| 67 | self.connection.send.has_been_called_with( |
|
| 68 | '<get_port_lists targets="1"/>' |
|
| 69 | ) |
|
| 70 | ||
| 71 | self.gmp.get_port_lists(targets=False) |
|
| 72 | ||
| 73 | self.connection.send.has_been_called_with( |
|
| 74 | '<get_port_lists targets="0"/>' |
|
| 75 | ) |
|
| 76 | ||
| 77 | ||
| @@ 22-74 (lines=53) @@ | ||
| 19 | import unittest |
|
| 20 | ||
| 21 | ||
| 22 | class GmpGetPortListsTestCase: |
|
| 23 | def test_get_port_lists(self): |
|
| 24 | self.gmp.get_port_lists() |
|
| 25 | ||
| 26 | self.connection.send.has_been_called_with('<get_port_lists/>') |
|
| 27 | ||
| 28 | def test_get_port_lists_with_filter(self): |
|
| 29 | self.gmp.get_port_lists(filter='foo=bar') |
|
| 30 | ||
| 31 | self.connection.send.has_been_called_with( |
|
| 32 | '<get_port_lists filter="foo=bar"/>' |
|
| 33 | ) |
|
| 34 | ||
| 35 | def test_get_port_lists_with_filter_id(self): |
|
| 36 | self.gmp.get_port_lists(filter_id='f1') |
|
| 37 | ||
| 38 | self.connection.send.has_been_called_with( |
|
| 39 | '<get_port_lists filt_id="f1"/>' |
|
| 40 | ) |
|
| 41 | ||
| 42 | def test_get_port_lists_with_trash(self): |
|
| 43 | self.gmp.get_port_lists(trash=True) |
|
| 44 | ||
| 45 | self.connection.send.has_been_called_with('<get_port_lists trash="1"/>') |
|
| 46 | ||
| 47 | self.gmp.get_port_lists(trash=False) |
|
| 48 | ||
| 49 | self.connection.send.has_been_called_with('<get_port_lists trash="0"/>') |
|
| 50 | ||
| 51 | def test_get_port_lists_with_details(self): |
|
| 52 | self.gmp.get_port_lists(details=True) |
|
| 53 | ||
| 54 | self.connection.send.has_been_called_with( |
|
| 55 | '<get_port_lists details="1"/>' |
|
| 56 | ) |
|
| 57 | ||
| 58 | self.gmp.get_port_lists(details=False) |
|
| 59 | ||
| 60 | self.connection.send.has_been_called_with( |
|
| 61 | '<get_port_lists details="0"/>' |
|
| 62 | ) |
|
| 63 | ||
| 64 | def test_get_port_lists_with_targets(self): |
|
| 65 | self.gmp.get_port_lists(targets=True) |
|
| 66 | ||
| 67 | self.connection.send.has_been_called_with( |
|
| 68 | '<get_port_lists targets="1"/>' |
|
| 69 | ) |
|
| 70 | ||
| 71 | self.gmp.get_port_lists(targets=False) |
|
| 72 | ||
| 73 | self.connection.send.has_been_called_with( |
|
| 74 | '<get_port_lists targets="0"/>' |
|
| 75 | ) |
|
| 76 | ||
| 77 | ||