| @@ 28-123 (lines=96) @@ | ||
| 25 | ) |
|
| 26 | ||
| 27 | ||
| 28 | class GmpModifyReportFormatTestCase: |
|
| 29 | def test_modify_report_format(self): |
|
| 30 | self.gmp.modify_report_format(report_format_id='rf1') |
|
| 31 | ||
| 32 | self.connection.send.has_been_called_with( |
|
| 33 | '<modify_report_format report_format_id="rf1"/>' |
|
| 34 | ) |
|
| 35 | ||
| 36 | def test_modify_report_format_missing_report_format_id(self): |
|
| 37 | with self.assertRaises(RequiredArgument): |
|
| 38 | self.gmp.modify_report_format(report_format_id=None) |
|
| 39 | ||
| 40 | with self.assertRaises(RequiredArgument): |
|
| 41 | self.gmp.modify_report_format(report_format_id='') |
|
| 42 | ||
| 43 | with self.assertRaises(RequiredArgument): |
|
| 44 | self.gmp.modify_report_format('') |
|
| 45 | ||
| 46 | def test_modify_report_format_with_summary(self): |
|
| 47 | self.gmp.modify_report_format(report_format_id='rf1', summary='foo') |
|
| 48 | ||
| 49 | self.connection.send.has_been_called_with( |
|
| 50 | '<modify_report_format report_format_id="rf1">' |
|
| 51 | '<summary>foo</summary>' |
|
| 52 | '</modify_report_format>' |
|
| 53 | ) |
|
| 54 | ||
| 55 | def test_modify_report_format_with_name(self): |
|
| 56 | self.gmp.modify_report_format(report_format_id='rf1', name='foo') |
|
| 57 | ||
| 58 | self.connection.send.has_been_called_with( |
|
| 59 | '<modify_report_format report_format_id="rf1">' |
|
| 60 | '<name>foo</name>' |
|
| 61 | '</modify_report_format>' |
|
| 62 | ) |
|
| 63 | ||
| 64 | def test_modify_report_format_with_name_and_type(self): |
|
| 65 | self.gmp.modify_report_format( |
|
| 66 | report_format_id=ReportFormatType.XML, name='foo' |
|
| 67 | ) |
|
| 68 | ||
| 69 | report_format_id = get_report_format_id_from_string('xml').value |
|
| 70 | self.connection.send.has_been_called_with( |
|
| 71 | '<modify_report_format report_format_id="{}">' |
|
| 72 | '<name>foo</name>' |
|
| 73 | '</modify_report_format>'.format(report_format_id) |
|
| 74 | ) |
|
| 75 | ||
| 76 | def test_modify_report_format_with_active(self): |
|
| 77 | self.gmp.modify_report_format(report_format_id='rf1', active=True) |
|
| 78 | ||
| 79 | self.connection.send.has_been_called_with( |
|
| 80 | '<modify_report_format report_format_id="rf1">' |
|
| 81 | '<active>1</active>' |
|
| 82 | '</modify_report_format>' |
|
| 83 | ) |
|
| 84 | ||
| 85 | self.gmp.modify_report_format(report_format_id='rf1', active=False) |
|
| 86 | ||
| 87 | self.connection.send.has_been_called_with( |
|
| 88 | '<modify_report_format report_format_id="rf1">' |
|
| 89 | '<active>0</active>' |
|
| 90 | '</modify_report_format>' |
|
| 91 | ) |
|
| 92 | ||
| 93 | def test_modify_report_format_with_param_name(self): |
|
| 94 | self.gmp.modify_report_format(report_format_id='rf1', param_name='foo') |
|
| 95 | ||
| 96 | self.connection.send.has_been_called_with( |
|
| 97 | '<modify_report_format report_format_id="rf1">' |
|
| 98 | '<param>' |
|
| 99 | '<name>foo</name>' |
|
| 100 | '</param>' |
|
| 101 | '</modify_report_format>' |
|
| 102 | ) |
|
| 103 | ||
| 104 | def test_modify_report_format_with_param_name_and_value(self): |
|
| 105 | self.gmp.modify_report_format( |
|
| 106 | report_format_id='rf1', param_name='foo', param_value='bar' |
|
| 107 | ) |
|
| 108 | ||
| 109 | self.connection.send.has_been_called_with( |
|
| 110 | '<modify_report_format report_format_id="rf1">' |
|
| 111 | '<param>' |
|
| 112 | '<name>foo</name>' |
|
| 113 | '<value>bar</value>' |
|
| 114 | '</param>' |
|
| 115 | '</modify_report_format>' |
|
| 116 | ) |
|
| 117 | ||
| 118 | self.gmp.modify_report_format( |
|
| 119 | report_format_id='rf1', param_name='foo', param_value='' |
|
| 120 | ) |
|
| 121 | ||
| 122 | self.connection.send.has_been_called_with( |
|
| 123 | '<modify_report_format report_format_id="rf1">' |
|
| 124 | '<param>' |
|
| 125 | '<name>foo</name>' |
|
| 126 | '<value></value>' |
|
| @@ 28-123 (lines=96) @@ | ||
| 25 | ) |
|
| 26 | ||
| 27 | ||
| 28 | class GmpModifyReportFormatTestCase: |
|
| 29 | def test_modify_report_format(self): |
|
| 30 | self.gmp.modify_report_format(report_format_id='rf1') |
|
| 31 | ||
| 32 | self.connection.send.has_been_called_with( |
|
| 33 | '<modify_report_format report_format_id="rf1"/>' |
|
| 34 | ) |
|
| 35 | ||
| 36 | def test_modify_report_format_missing_report_format_id(self): |
|
| 37 | with self.assertRaises(RequiredArgument): |
|
| 38 | self.gmp.modify_report_format(report_format_id=None) |
|
| 39 | ||
| 40 | with self.assertRaises(RequiredArgument): |
|
| 41 | self.gmp.modify_report_format(report_format_id='') |
|
| 42 | ||
| 43 | with self.assertRaises(RequiredArgument): |
|
| 44 | self.gmp.modify_report_format('') |
|
| 45 | ||
| 46 | def test_modify_report_format_with_summary(self): |
|
| 47 | self.gmp.modify_report_format(report_format_id='rf1', summary='foo') |
|
| 48 | ||
| 49 | self.connection.send.has_been_called_with( |
|
| 50 | '<modify_report_format report_format_id="rf1">' |
|
| 51 | '<summary>foo</summary>' |
|
| 52 | '</modify_report_format>' |
|
| 53 | ) |
|
| 54 | ||
| 55 | def test_modify_report_format_with_name(self): |
|
| 56 | self.gmp.modify_report_format(report_format_id='rf1', name='foo') |
|
| 57 | ||
| 58 | self.connection.send.has_been_called_with( |
|
| 59 | '<modify_report_format report_format_id="rf1">' |
|
| 60 | '<name>foo</name>' |
|
| 61 | '</modify_report_format>' |
|
| 62 | ) |
|
| 63 | ||
| 64 | def test_modify_report_format_with_name_and_type(self): |
|
| 65 | self.gmp.modify_report_format( |
|
| 66 | report_format_id=ReportFormatType.XML, name='foo' |
|
| 67 | ) |
|
| 68 | ||
| 69 | report_format_id = get_report_format_id_from_string('xml').value |
|
| 70 | self.connection.send.has_been_called_with( |
|
| 71 | '<modify_report_format report_format_id="{}">' |
|
| 72 | '<name>foo</name>' |
|
| 73 | '</modify_report_format>'.format(report_format_id) |
|
| 74 | ) |
|
| 75 | ||
| 76 | def test_modify_report_format_with_active(self): |
|
| 77 | self.gmp.modify_report_format(report_format_id='rf1', active=True) |
|
| 78 | ||
| 79 | self.connection.send.has_been_called_with( |
|
| 80 | '<modify_report_format report_format_id="rf1">' |
|
| 81 | '<active>1</active>' |
|
| 82 | '</modify_report_format>' |
|
| 83 | ) |
|
| 84 | ||
| 85 | self.gmp.modify_report_format(report_format_id='rf1', active=False) |
|
| 86 | ||
| 87 | self.connection.send.has_been_called_with( |
|
| 88 | '<modify_report_format report_format_id="rf1">' |
|
| 89 | '<active>0</active>' |
|
| 90 | '</modify_report_format>' |
|
| 91 | ) |
|
| 92 | ||
| 93 | def test_modify_report_format_with_param_name(self): |
|
| 94 | self.gmp.modify_report_format(report_format_id='rf1', param_name='foo') |
|
| 95 | ||
| 96 | self.connection.send.has_been_called_with( |
|
| 97 | '<modify_report_format report_format_id="rf1">' |
|
| 98 | '<param>' |
|
| 99 | '<name>foo</name>' |
|
| 100 | '</param>' |
|
| 101 | '</modify_report_format>' |
|
| 102 | ) |
|
| 103 | ||
| 104 | def test_modify_report_format_with_param_name_and_value(self): |
|
| 105 | self.gmp.modify_report_format( |
|
| 106 | report_format_id='rf1', param_name='foo', param_value='bar' |
|
| 107 | ) |
|
| 108 | ||
| 109 | self.connection.send.has_been_called_with( |
|
| 110 | '<modify_report_format report_format_id="rf1">' |
|
| 111 | '<param>' |
|
| 112 | '<name>foo</name>' |
|
| 113 | '<value>bar</value>' |
|
| 114 | '</param>' |
|
| 115 | '</modify_report_format>' |
|
| 116 | ) |
|
| 117 | ||
| 118 | self.gmp.modify_report_format( |
|
| 119 | report_format_id='rf1', param_name='foo', param_value='' |
|
| 120 | ) |
|
| 121 | ||
| 122 | self.connection.send.has_been_called_with( |
|
| 123 | '<modify_report_format report_format_id="rf1">' |
|
| 124 | '<param>' |
|
| 125 | '<name>foo</name>' |
|
| 126 | '<value></value>' |
|
| @@ 28-123 (lines=96) @@ | ||
| 25 | ) |
|
| 26 | ||
| 27 | ||
| 28 | class GmpModifyReportFormatTestCase: |
|
| 29 | def test_modify_report_format(self): |
|
| 30 | self.gmp.modify_report_format(report_format_id='rf1') |
|
| 31 | ||
| 32 | self.connection.send.has_been_called_with( |
|
| 33 | '<modify_report_format report_format_id="rf1"/>' |
|
| 34 | ) |
|
| 35 | ||
| 36 | def test_modify_report_format_missing_report_format_id(self): |
|
| 37 | with self.assertRaises(RequiredArgument): |
|
| 38 | self.gmp.modify_report_format(report_format_id=None) |
|
| 39 | ||
| 40 | with self.assertRaises(RequiredArgument): |
|
| 41 | self.gmp.modify_report_format(report_format_id='') |
|
| 42 | ||
| 43 | with self.assertRaises(RequiredArgument): |
|
| 44 | self.gmp.modify_report_format('') |
|
| 45 | ||
| 46 | def test_modify_report_format_with_summary(self): |
|
| 47 | self.gmp.modify_report_format(report_format_id='rf1', summary='foo') |
|
| 48 | ||
| 49 | self.connection.send.has_been_called_with( |
|
| 50 | '<modify_report_format report_format_id="rf1">' |
|
| 51 | '<summary>foo</summary>' |
|
| 52 | '</modify_report_format>' |
|
| 53 | ) |
|
| 54 | ||
| 55 | def test_modify_report_format_with_name(self): |
|
| 56 | self.gmp.modify_report_format(report_format_id='rf1', name='foo') |
|
| 57 | ||
| 58 | self.connection.send.has_been_called_with( |
|
| 59 | '<modify_report_format report_format_id="rf1">' |
|
| 60 | '<name>foo</name>' |
|
| 61 | '</modify_report_format>' |
|
| 62 | ) |
|
| 63 | ||
| 64 | def test_modify_report_format_with_name_and_type(self): |
|
| 65 | self.gmp.modify_report_format( |
|
| 66 | report_format_id=ReportFormatType.XML, name='foo' |
|
| 67 | ) |
|
| 68 | ||
| 69 | report_format_id = get_report_format_id_from_string('xml').value |
|
| 70 | self.connection.send.has_been_called_with( |
|
| 71 | '<modify_report_format report_format_id="{}">' |
|
| 72 | '<name>foo</name>' |
|
| 73 | '</modify_report_format>'.format(report_format_id) |
|
| 74 | ) |
|
| 75 | ||
| 76 | def test_modify_report_format_with_active(self): |
|
| 77 | self.gmp.modify_report_format(report_format_id='rf1', active=True) |
|
| 78 | ||
| 79 | self.connection.send.has_been_called_with( |
|
| 80 | '<modify_report_format report_format_id="rf1">' |
|
| 81 | '<active>1</active>' |
|
| 82 | '</modify_report_format>' |
|
| 83 | ) |
|
| 84 | ||
| 85 | self.gmp.modify_report_format(report_format_id='rf1', active=False) |
|
| 86 | ||
| 87 | self.connection.send.has_been_called_with( |
|
| 88 | '<modify_report_format report_format_id="rf1">' |
|
| 89 | '<active>0</active>' |
|
| 90 | '</modify_report_format>' |
|
| 91 | ) |
|
| 92 | ||
| 93 | def test_modify_report_format_with_param_name(self): |
|
| 94 | self.gmp.modify_report_format(report_format_id='rf1', param_name='foo') |
|
| 95 | ||
| 96 | self.connection.send.has_been_called_with( |
|
| 97 | '<modify_report_format report_format_id="rf1">' |
|
| 98 | '<param>' |
|
| 99 | '<name>foo</name>' |
|
| 100 | '</param>' |
|
| 101 | '</modify_report_format>' |
|
| 102 | ) |
|
| 103 | ||
| 104 | def test_modify_report_format_with_param_name_and_value(self): |
|
| 105 | self.gmp.modify_report_format( |
|
| 106 | report_format_id='rf1', param_name='foo', param_value='bar' |
|
| 107 | ) |
|
| 108 | ||
| 109 | self.connection.send.has_been_called_with( |
|
| 110 | '<modify_report_format report_format_id="rf1">' |
|
| 111 | '<param>' |
|
| 112 | '<name>foo</name>' |
|
| 113 | '<value>bar</value>' |
|
| 114 | '</param>' |
|
| 115 | '</modify_report_format>' |
|
| 116 | ) |
|
| 117 | ||
| 118 | self.gmp.modify_report_format( |
|
| 119 | report_format_id='rf1', param_name='foo', param_value='' |
|
| 120 | ) |
|
| 121 | ||
| 122 | self.connection.send.has_been_called_with( |
|
| 123 | '<modify_report_format report_format_id="rf1">' |
|
| 124 | '<param>' |
|
| 125 | '<name>foo</name>' |
|
| 126 | '<value></value>' |
|
| @@ 28-123 (lines=96) @@ | ||
| 25 | ) |
|
| 26 | ||
| 27 | ||
| 28 | class GmpModifyReportFormatTestCase: |
|
| 29 | def test_modify_report_format(self): |
|
| 30 | self.gmp.modify_report_format(report_format_id='rf1') |
|
| 31 | ||
| 32 | self.connection.send.has_been_called_with( |
|
| 33 | '<modify_report_format report_format_id="rf1"/>' |
|
| 34 | ) |
|
| 35 | ||
| 36 | def test_modify_report_format_missing_report_format_id(self): |
|
| 37 | with self.assertRaises(RequiredArgument): |
|
| 38 | self.gmp.modify_report_format(report_format_id=None) |
|
| 39 | ||
| 40 | with self.assertRaises(RequiredArgument): |
|
| 41 | self.gmp.modify_report_format(report_format_id='') |
|
| 42 | ||
| 43 | with self.assertRaises(RequiredArgument): |
|
| 44 | self.gmp.modify_report_format('') |
|
| 45 | ||
| 46 | def test_modify_report_format_with_summary(self): |
|
| 47 | self.gmp.modify_report_format(report_format_id='rf1', summary='foo') |
|
| 48 | ||
| 49 | self.connection.send.has_been_called_with( |
|
| 50 | '<modify_report_format report_format_id="rf1">' |
|
| 51 | '<summary>foo</summary>' |
|
| 52 | '</modify_report_format>' |
|
| 53 | ) |
|
| 54 | ||
| 55 | def test_modify_report_format_with_name(self): |
|
| 56 | self.gmp.modify_report_format(report_format_id='rf1', name='foo') |
|
| 57 | ||
| 58 | self.connection.send.has_been_called_with( |
|
| 59 | '<modify_report_format report_format_id="rf1">' |
|
| 60 | '<name>foo</name>' |
|
| 61 | '</modify_report_format>' |
|
| 62 | ) |
|
| 63 | ||
| 64 | def test_modify_report_format_with_name_and_type(self): |
|
| 65 | self.gmp.modify_report_format( |
|
| 66 | report_format_id=ReportFormatType.XML, name='foo' |
|
| 67 | ) |
|
| 68 | ||
| 69 | report_format_id = get_report_format_id_from_string('xml').value |
|
| 70 | self.connection.send.has_been_called_with( |
|
| 71 | '<modify_report_format report_format_id="{}">' |
|
| 72 | '<name>foo</name>' |
|
| 73 | '</modify_report_format>'.format(report_format_id) |
|
| 74 | ) |
|
| 75 | ||
| 76 | def test_modify_report_format_with_active(self): |
|
| 77 | self.gmp.modify_report_format(report_format_id='rf1', active=True) |
|
| 78 | ||
| 79 | self.connection.send.has_been_called_with( |
|
| 80 | '<modify_report_format report_format_id="rf1">' |
|
| 81 | '<active>1</active>' |
|
| 82 | '</modify_report_format>' |
|
| 83 | ) |
|
| 84 | ||
| 85 | self.gmp.modify_report_format(report_format_id='rf1', active=False) |
|
| 86 | ||
| 87 | self.connection.send.has_been_called_with( |
|
| 88 | '<modify_report_format report_format_id="rf1">' |
|
| 89 | '<active>0</active>' |
|
| 90 | '</modify_report_format>' |
|
| 91 | ) |
|
| 92 | ||
| 93 | def test_modify_report_format_with_param_name(self): |
|
| 94 | self.gmp.modify_report_format(report_format_id='rf1', param_name='foo') |
|
| 95 | ||
| 96 | self.connection.send.has_been_called_with( |
|
| 97 | '<modify_report_format report_format_id="rf1">' |
|
| 98 | '<param>' |
|
| 99 | '<name>foo</name>' |
|
| 100 | '</param>' |
|
| 101 | '</modify_report_format>' |
|
| 102 | ) |
|
| 103 | ||
| 104 | def test_modify_report_format_with_param_name_and_value(self): |
|
| 105 | self.gmp.modify_report_format( |
|
| 106 | report_format_id='rf1', param_name='foo', param_value='bar' |
|
| 107 | ) |
|
| 108 | ||
| 109 | self.connection.send.has_been_called_with( |
|
| 110 | '<modify_report_format report_format_id="rf1">' |
|
| 111 | '<param>' |
|
| 112 | '<name>foo</name>' |
|
| 113 | '<value>bar</value>' |
|
| 114 | '</param>' |
|
| 115 | '</modify_report_format>' |
|
| 116 | ) |
|
| 117 | ||
| 118 | self.gmp.modify_report_format( |
|
| 119 | report_format_id='rf1', param_name='foo', param_value='' |
|
| 120 | ) |
|
| 121 | ||
| 122 | self.connection.send.has_been_called_with( |
|
| 123 | '<modify_report_format report_format_id="rf1">' |
|
| 124 | '<param>' |
|
| 125 | '<name>foo</name>' |
|
| 126 | '<value></value>' |
|