Exemple #1
0
    def test_existing_interface(self):
        """
        Tests with an existing network interface.
        """

        # pylint: disable=no-self-use

        with patch("probequest.config.get_if_list", return_value=("wlan0",
                   "wlan0mon")):
            config = Config()
            config.interface = "wlan0"
Exemple #2
0
    def test_non_existing_interface(self):
        """
        Tests if an exception is well raised when setting a non-existing
        network interface.
        """

        with patch("probequest.config.get_if_list", return_value=("wlan0",
                   "wlan0mon")):
            config = Config()

            with self.assertRaises(InterfaceDoesNotExistException):
                config.interface = "wlan1"