<commit_before># -*- coding: utf-8 -*-
"""Test for tmuxp Window object."""

from __future__ import (absolute_import, division, print_function,
                        unicode_literals, with_statement)

import logging
import pytest

from libtmux import Pane, Server, Window


logger = logging.getLogger(__name__)


def test_select_window(session):
    window_count = len(session._windows)
    # to do, get option for   base-index from tmux
    # for now hoever, let's get the index from the first window.
    assert window_count == 1

    window_base_index = int(
        session.attached_window.get('window_index'))

    window = session.new_window(window_name='testing 3')

    # self.assertEqual(2,
    # int(session.attached_window.get('window_index')))
    assert int(window_base_index) + 1 == int(window.get('window_index'))

    session.select_window(window_base_index)
    assert window_base_index == \
        int(session.attached_window.get('window_index'))

    session.select_window('testing 3')
    assert int(window_base_index) + 1 == \
        int(session.attached_window.get('window_index'))

    assert len(session._windows) == 2


def test_zfresh_window_data(session):
    pane_base_index = int(
        session.attached_window.show_window_option(
            'pane-base-index', g=True
        )
    )

    assert len(session.windows) == 1

    assert len(session.attached_window.panes) == 1
    current_windows = len(session._windows)
    assert session.get('session_id') != '@0'
    assert current_windows == 1

    assert len(session.attached_window.panes) == 1<commit_msg>Update window tests to use .index<commit_after># -*- coding: utf-8 -*-
"""Test for tmuxp Window object."""

from __future__ import (absolute_import, division, print_function,
                        unicode_literals, with_statement)

import logging
import pytest

from libtmux import Pane, Server, Window


logger = logging.getLogger(__name__)


def test_select_window(session):
    window_count = len(session._windows)
    # to do, get option for   base-index from tmux
    # for now hoever, let's get the index from the first window.
    assert window_count == 1

    window_base_index = int(session.attached_window.index)

    window = session.new_window(window_name='testing 3')

    # self.assertEqual(2,
    # int(session.attached_window.index))
    assert int(window_base_index) + 1 == int(window.index)

    session.select_window(window_base_index)
    assert window_base_index == int(session.attached_window.index)

    session.select_window('testing 3')
    assert int(window_base_index) + 1 == int(session.attached_window.index)

    assert len(session._windows) == 2


def test_zfresh_window_data(session):
    pane_base_index = int(
        session.attached_window.show_window_option(
            'pane-base-index', g=True
        )
    )

    assert len(session.windows) == 1

    assert len(session.attached_window.panes) == 1
    current_windows = len(session._windows)
    assert session.get('session_id') != '@0'
    assert current_windows == 1

    assert len(session.attached_window.panes) == 1
{'fraction_non_alphanumeric': 0.10653363373028645, 'fraction_numerical': 0.008368200836820083, 'mean_word_length': 3.570588235294118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4361788', 'n_tokens_mistral': 990, 'n_tokens_neox': 939, 'n_words': 209}