Example #1
0
    def test_check_set(self):
        '''
        Test for Check that given ipset set exists.
        '''
        self.assertEqual(ipset.check_set(), 'Error: Set needs to be specified')

        with patch.object(ipset, '_find_set_info', side_effect=[False, True]):
            self.assertFalse(ipset.check_set('set'))
            self.assertTrue(ipset.check_set('set'))
Example #2
0
def test_check_set():
    """
    Test for Check that given ipset set exists.
    """
    assert ipset.check_set() == "Error: Set needs to be specified"

    with patch.object(ipset, "_find_set_info", side_effect=[False, True]):
        assert not ipset.check_set("set")
        assert ipset.check_set("set")
Example #3
0
    def test_check_set(self):
        '''
        Test for Check that given ipset set exists.
        '''
        self.assertEqual(ipset.check_set(), 'Error: Set needs to be specified')

        with patch.object(ipset, '_find_set_info', side_effect=[False, True]):
            self.assertFalse(ipset.check_set('set'))
            self.assertTrue(ipset.check_set('set'))
Example #4
0
    def test_check_set(self):
        """
        Test for Check that given ipset set exists.
        """
        self.assertEqual(ipset.check_set(), "Error: Set needs to be specified")

        with patch.object(ipset, "_find_set_info", side_effect=[False, True]):
            self.assertFalse(ipset.check_set("set"))
            self.assertTrue(ipset.check_set("set"))