Ejemplo n.º 1
0
    def test_do_not_reset_when_not_changing_off_state(self, uci, reset):
        self.with_usage_in_mb(uci, "20")
        uci.set("openwireless.maxmonthlybandwidth", "10")
        uci.set("wireless.@wifi-iface[1].disabled", "1")
        uci.commit("openwireless")
        uci.commit("wireless")

        accumulate_bytes.update_network_availability()

        self.assertFalse(reset.called)
    def test_do_not_reset_when_not_changing_off_state(self, uci, reset):
        self.with_usage_in_mb(uci, "20")
        uci.set("openwireless.maxmonthlybandwidth", "10")
        uci.set("wireless.@wifi-iface[1].disabled", "1")
        uci.commit("openwireless")
        uci.commit("wireless")

        accumulate_bytes.update_network_availability()

        self.assertFalse(reset.called)
Ejemplo n.º 3
0
    def test_turn_off_adapter_if_on_and_insufficient_bandwidth(self, uci, reset):
        self.with_usage_in_mb(uci, "20")
        uci.set("openwireless.maxmonthlybandwidth", "20")
        uci.set("wireless.@wifi-iface[1].disabled", "0")
        uci.commit("openwireless")
        uci.commit("wireless")

        accumulate_bytes.update_network_availability()

        self.assertEquals(uci.get("wireless.@wifi-iface[1].disabled"), "1")
        reset.assert_called_with()
    def test_turn_on_adapter_if_off_and_sufficient_bandwidth(self, uci, reset):
        uci.set("openwireless.maxmonthlybandwidth", "20")
        uci.set("wireless.@wifi-iface[1].disabled", "1")
        self.with_usage_in_mb(uci, "0")
        uci.commit("openwireless")
        uci.commit("wireless")

        accumulate_bytes.update_network_availability()

        self.assertEquals(uci.get("wireless.@wifi-iface[1].disabled"), "0")
        reset.assert_called_with()