def test_internet_is_ok_after_first_check(self):
        # Given
        connection_handler = ConnectionHandler(*fake_params)

        # When
        connection_handler.update()

        # Then
        self.assertTrue(connection_handler.internet_ok)
Example #2
0
    def test_internet_is_ok_after_first_check(self):
        # Given
        connection_handler = ConnectionHandler(*fake_params)

        # When
        connection_handler.update()

        # Then
        self.assertTrue(connection_handler.internet_ok)
    def test_have_internet_again(self):
        # Given
        connection_handler = ConnectionHandler(*fake_params)
        connection_handler.internet_ok = False

        # When
        connection_handler.update()

        # Then
        self.assertTrue(connection_handler.internet_ok)
    def test_when_no_internet(self):
        # Given
        connection_handler = ConnectionHandler(*fake_params)
        connection_handler.check_internet_call = MagicMock(side_effect=Exception('HTTP Error'))

        # When
        connection_handler.update()

        # Then
        self.assertFalse(connection_handler.internet_ok)
Example #5
0
    def test_have_internet_again(self):
        # Given
        connection_handler = ConnectionHandler(*fake_params)
        connection_handler.internet_ok = False

        # When
        connection_handler.update()

        # Then
        self.assertTrue(connection_handler.internet_ok)
Example #6
0
    def test_when_no_internet(self):
        # Given
        connection_handler = ConnectionHandler(*fake_params)
        connection_handler.check_internet_call = MagicMock(
            side_effect=Exception('HTTP Error'))

        # When
        connection_handler.update()

        # Then
        self.assertFalse(connection_handler.internet_ok)