Changeset - 3a4f7bb39a21
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 12 years ago 2013-07-24 22:50:35
branko@majic.rs
Noticket: Added two more tests for better coverage of Communication model.
1 file changed with 22 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conntrackt/tests/test_models.py
Show inline comments
 
@@ -250,6 +250,28 @@ class CommunicationTest(TestCase):
 

	
 
        comm = Communication.objects.get(pk=1)
 

	
 
        expected = "Test Entity 2 -> Test Entity 1 (TCP:22)"
 

	
 
        self.assertEqual(expected, str(comm))
 

	
 
    def test_source_representation(self):
 
        """
 
        Test the representation of communication from source perspective.
 
        """
 

	
 
        comm = Communication.objects.get(pk=1)
 

	
 
        expected = "Test Entity 2 (192.168.1.2) - TCP: 22"
 

	
 
        self.assertEqual(expected, comm.source_representation())
 

	
 
    def test_destination_representation(self):
 
        """
 
        Test the representation of communication from destination perspective.
 
        """
 

	
 
        comm = Communication.objects.get(pk=1)
 

	
 
        expected = "Test Entity 1 (192.168.1.1) - TCP: 22"
 

	
 
        self.assertEqual(expected, comm.destination_representation())
0 comments (0 inline, 0 general)