示例#1
0
 def test_next_tag_with_use_tags(self):
     """Test get next availabe tags returns different tags"""
     link = Link(self.iface1, self.iface2)
     tag = link.get_next_available_tag()
     is_available = link.is_tag_available(tag)
     self.assertFalse(is_available)
     link.use_tag(tag)
示例#2
0
    def test_use_tag__error(self, mock_is_tag_available):
        """Test use_tag method to error case."""
        mock_is_tag_available.side_effect = [True, False]
        link = Link(self.iface1, self.iface2)

        result = link.use_tag(Mock())
        self.assertFalse(result)
示例#3
0
    def test_use_tag__success(self, mock_is_tag_available):
        """Test use_tag method to success case."""
        mock_is_tag_available.side_effect = [True, True]
        link = Link(self.iface1, self.iface2)

        result = link.use_tag(Mock())
        self.assertTrue(result)