Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 11, 2024
1 parent 71c24db commit cac83b1
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions tests/test_SdbBody.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

0 comments on commit cac83b1

Please sign in to comment.