From 4465d3229122e52f869f27962ff1372dd9b41ae1 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Wed, 10 Jul 2024 16:59:37 -0700 Subject: [PATCH] Fix test. --- tests/test_SdbBody.py | 51 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/tests/test_SdbBody.py b/tests/test_SdbBody.py index 12657d8e4..9441f2b82 100644 --- a/tests/test_SdbBody.py +++ b/tests/test_SdbBody.py @@ -5,31 +5,6 @@ # TODO Rename test names so each one represents clearly what it is # testing for. -class TestSdpBodyFunctions(unittest.TestCase): - - def test_localStr(self): - got = SdpBody(sdp_multi_stream).localStr('1.2.3.4', 12345) - want = sdp_multi_stream.replace('\n','\r\n') - self.assertEquals(want, got) - - def test_str_override_multiple_stremas(self): - got = SdpBody(sdp_multi_stream) - want = sdp_multi_stream.replace('\n','\r\n') - self.assertEquals(want, str(got)) - - def test_str_override_h323_sdp(self): - got = SdpBody(sdp_h323) - want = sdp_h323.replace('\n','\r\n') - self.assertEquals(want, str(got)) - - def test_str_override_single_audio(self): - got = SdpBody(sdp_single_audio) - want = sdp_single_audio.replace('\n','\r\n') - self.assertEquals(want, str(got)) - -if __name__ == '__main__': - unittest.main() - # Test data... sdp_multi_stream = """v=0 o=LifeSize 1366021474 2 IN IP4 192.168.190.101 @@ -112,3 +87,29 @@ def test_str_override_single_audio(self): a=ptime:30 a=sendrecv """ + +class TestSdpBodyFunctions(unittest.TestCase): + + def test_localStr(self): + laddr = (('1.2.3.4', 12345), 'udp') + got = SdpBody(sdp_multi_stream).localStr(laddr) + want = sdp_multi_stream.replace('\n','\r\n') + self.assertEqual(want, got) + + def test_str_override_multiple_stremas(self): + got = SdpBody(sdp_multi_stream) + want = sdp_multi_stream.replace('\n','\r\n') + self.assertEqual(want, str(got)) + + def test_str_override_h323_sdp(self): + got = SdpBody(sdp_h323) + want = sdp_h323.replace('\n','\r\n') + self.assertEqual(want, str(got)) + + def test_str_override_single_audio(self): + got = SdpBody(sdp_single_audio) + want = sdp_single_audio.replace('\n','\r\n') + self.assertEqual(want, str(got)) + +if __name__ == '__main__': + unittest.main()