arrangeit v0.3alpha documentation

https://travis-ci.org/ipaleka/arrangeit.svg?branch=master https://coveralls.io/repos/github/ipaleka/arrangeit/badge.svg

arrangeit is a cross-platform desktop utility that helps you placing your desktop’s open windows. It is a utility mostly based on the mouse movements, with some keyboard shortcuts as helpers.

Version 0.91 was the last published version of a Win95/98 desktop utility named ArrangeIt. Twenty years later, new software with the name arrangeit is born. It has been developed from the scratch in Python and the initial public release v0.3alpha is now available to download from the Github. Please bear in mind that this version is alpha software and it’s not suitable for production.

It should be possible to run arrangeit v0.3alpha under X Windows in GNU/Linux (Wayland is not supported. Yet…) and under MS Windows.

Mac OS X support is expected in the next v0.4beta release.

Installation

You may download arrangeit v0.3alpha either in the form of a binary distribution package (pick your platform and Python version from the project’s releases page on Github) or as a source package distribution.

Minimum requirements for Python is version 3.5.

GNU/Linux

Binary distribution

For now, only Debian/Ubuntu binary releases for Python 3.5, 3.6 and 3.7 can be downloaded from the releases page.

Download binaries of your choice and place them in a temporary directory. Install arrangeit by typing the following commands in terminal:

$ sudo apt-get install python3-pil.imagetk python3-xlib
$ cd tmp_directory
$ sudo dpkg -i python3-pynput_1.4.2_all.deb
$ sudo dpkg -i arrangeit_0.3alpha_all.deb

Run the executable with:

$ arrangeit
Uninstallation

If you want, you may uninstall the software with:

$ sudo apt-get purge arrangeit
$ sudo apt-get autoremove --purge

Also, if you’ve saved some data or changed some settings from the options dialog, then you may delete every trace of that by removing the data directory:

$ rm -rf ~/.local/share/arrangeit

Source distribution

Use the following commands in Ubuntu to prepare and run arrangeit:

# install requirements
$ sudo apt-get install python3-dev git gcc \
    libgirepository1.0-dev libcairo2-dev pkg-config gir1.2-gtk-3.0

# change current directory to the one where you keep your projects
$ cd ~/projects

# clone arrangeit repository (or you may download it as a compressed directory)
$ git clone https://github.com/ipaleka/arrangeit.git

# create directory for the virtual environments if you don't have it already
$ mkdir venvs
# create virtual environment for arrangeit
$ python3 -m venv venvs/arrangeit
# activate newly created virtual environment
$ source venvs/arrangeit

# install Python dependencies
(arrangeit) $ cd arrangeit
(arrangeit) $ python -m pip install -r requirements/linux.txt

# run arrangeit
(arrangeit) $ python -m arrangeit

MS Windows

Binary distribution

Provided binary release downloaded from the releases page is in the form of a compressed directory.

Extract it in a directory of your choice and run the arrangeit.exe executable by clicking it. You may also, of course, create a shortcut to that executable and place it on the desktop or in some other place of choice.

Uninstallation

No runtime files will be placed outside that directory during a run. If you’ve changed some settings or saved the data in the options dialog, then your configuration files would be saved in arrangeit directory under your user’s directory.

If you want to delete every trace of arrangeit software, then you should delete that directory (typically c:\Users\yourusername\arrangeit) and the directory where you extracted the binary distribution.

Source distribution

You should install Python 3 first in order to run arrangeit from the source in MS Windows.

Then you should either download source archive and extract it in a directory of your choice or you may clone arrangeit repository (detailed instructions are in the development page).

You should take the following steps in order to prepare and run arrangeit from source distribution in MS Windows:

:: change current directory to the one where you keep your projects
cd projects

:: create directory for the virtual environments if you don't have it already
mkdir venvs
:: create virtual environment for arrangeit
python -m venv venvs\arrangeit
:: activate newly created virtual environment with
venvs\arrangeit\Scripts\activate.bat

:: enter the extracted source distribution directory
(arrangeit) cd arrangeit

:: install Python dependencies
(arrangeit) python -m pip install -r requirements/windows.txt

:: run arrangeit
(arrangeit) python -m arrangeit

User guide

Basic principles

arrangeit collects all the available open windows and puts them in a queue for operation. Ending operation on the current window is followed by starting operation on the next window in the queue. arrangeit v0.3alpha ends its execution after all the windows are exhausted and it should be started again for additional operations.

User interface

A box with the title of currently operating window occupies the top-left position of the main window. That window’s application name and icon are placed at the top-right.

The other windows in the queue are placed below the title box, in the order in which arrangeit will operate on them.

Workspaces boxes are placed on the right side of the listed windows, with the emphasized color for the current window workspace.

The status bar for displaying software messages is placed at the bottom of the main window.

Quit button and the button bringing options dialog (some basic program settings may be changed from there) are at the bottom-right of the main window.

Main operations

The default state of the program is its operational state. It means that moving the mouse cursor automatically moves the main window. That is the positioning phase of the software in which you’re choosing the future position on the screen for the current window.

You switch to resizing phase by pressing the left button of the mouse. There will be no resizing phase for a fixed size window, so a left click in such a case will switch to the positioning phase of the next window in the queue.

Click the middle mouse button or press Shift key on your keyboard to release the mouse. That will stop the positioning/resizing phase and the other functionalities of the software will be allowed instead.

Positioning phase

As you move your mouse you also move the arrangeit main window. You may set the future position of the window by pressing the left mouse button or by Enter key on your keyboard. The starting corner of the resizing phase can be picked either by pressing Ctrl key or it can be set automatically by the snapping process.

The main window will snap next to the other windows if it is moved close enough to them. From the options dialog you may choose a snap distance or you may completely turn off the snap functionality.

Press the right mouse button or Space on keyboard to skip the current window and start to operate on the next window in the queue.

You may reposition listed windows starting from the desired window by releasing the mouse and clicking its title in the listed window collection. If you don’t want to release the mouse for the action, you may activate a window by its ordinal number from the corresponding F key (F1 for the first window in the queue, F2 for the second, etc.).

To move current window to another workspace/desktop, click that workspace in the workspace list after releasing the mouse. Press a related number on your keyboard to switch to a workspace without releasing the mouse.

When you confirm the position by pressing the left mouse button (or by pressing the Enter key on your keyboard), the resizing phase starts for non-fixed size window.

Resizing phase

Your cursor is positioned at the opposite corner of staring point set in positioning phase. You are setting the ending corner of the window in resizing phase - just press the left mouse button when you are ready. You’ll be switched to the next window in the queue afterward, while the previous window will be positioned and resized based on the actions you did.

Target window background image is shown as the main window background during the resizing phase. From the options dialog you may set should that image be in grayscale. you may set the size for the blur filter, or you may completely turn off the background image and set the background to be made from the main background color instead.

If you release mouse (mouse middle button click or Shift on keyboard) then the resizing phase will be canceled and recapturing the mouse starts from the positioning phase.

Other operations

You access other operations either by keyboard shortcuts or by releasing the mouse cursor and use it to select some other functionality beside positioning/resizing.

Changing window properties

If the current window is a fixed size window, then there would be no resizing phase after left click - it will be immediately placed and the positioning phase for the next window in the queue will start afterward.

You may change that default behavior by clicking resizable in the window title box. It works the other way around too: if you click fixed for resizable window, then it will be just placed after positioning phase like it was a fixed size window.

Similar behavior is applicable for restored/minimized windows too: currently minimized window will be restored after resizing phase if you click restore, and currently restored window will be minimized if you click minimize.

Note

In GNU/Linux if a window is pinned (visible in all workspaces) then if you change a workspace during the window operation, you will unpin that window and so make it visible in the selected workspace only.

Keyboard shortcuts

Key Mouse counterpart Action
Enter left-click confirm position
Esc Quit button quit program
Space right-click skip window
Ctrl by snapping cycle corner
Shift middle-click release mouse
R resizable icon turn on/off resizing phase
M minimize icon make window minimized/restored
1-9 click workspace change workspace
F1-F12 click listed window restart from selected window

Options

You may change some program settings from the options dialog started after you release the mouse and click the Options button at the bottom-right of the main window.

A setting value would be changed and saved immediately after selecting, but some settings changing require program restart in order to take effect.

Development

This section is about the requirements necessary to develop arrangeit software.

System requirements

GNU/Linux

Ubuntu

To start arrangeit development on Ubuntu, you should install some system packages by issuing the following command:

$ sudo apt-get install python3-dev git gcc pkg-config libcairo2-dev \
    libgirepository1.0-dev gir1.2-gtk-3.0  gir1.2-wnck-3.0

If you are planning to build latexpdf documentation then you should install some additional packages with:

$ sudo apt-get install texlive texlive-latex-extra latexmk
elementaryOS 5.0 (juno)
$ sudo apt-get install python3-dev python3-venv git python3-tk \
    pkg-config libgirepository1.0-dev
Debian Stretch
$ su
# apt-get install python3-dev python3-venv python3-tk git pkg-config \
    libcairo2-dev libgirepository1.0-dev gir1.2-gtk-3.0 gir1.2-wnck-3.0
Debian Buster
$ su
# apt-get install python3-dev python3-venv python3-tk git gcc \
    pkg-config libcairo2-dev libgirepository1.0-dev
Manjaro 18.04 Xfce
$ sudo pacman -S gobject-introspection tk

MS Windows

Official Python 3 installer and git for Windows probably represent the easiest way to start development on MS Windows.

Mac OS X

Download the official installer and install Python 3 by executing .pkg file. Finally, run provided post-install script Install Certificates.command.

Python requirements

You should develop arrangeit in a dedicated virtual environment. If you don’t have any other preferred way, then probably the easiest way to create a virtual environment would be venv integrated with Python 3.5+.

For example, if you place your projects in projects directory and path to arrangeit root directory is /home/yourusername/projects/arrangeit (or c:\Users\yourusername\projects\arrangeit on MS Windows), then you may create a directory inside projects directory to hold your virtual environments.

$ cd ~/projects
$ mkdir venvs
$ cd venvs

Create a new virtual environment with:

$ python3 -m venv arrangeit

The virtual environment is activated on GNU/Linux from venvs directory with:

$ source arrangeit/bin/activate

Or in MS Windows with:

Install the base requirements by issuing the following from the project’s root directory:

(arrangeit) $ python -m pip install -U -r requirements/linux.txt

And all the necessary Python dependency packages for arrangeit development with:

(arrangeit) $ python -m pip install -U -r requirements/base_development.txt

Additional tools

pygettext

pygettext is a Python wrapper for xgettext and it ships with Python. To prepare translation template, run the following command on Ubuntu from the project’s root directory:

find ./arrangeit -iname "*.py" | xargs pygettext3 --verbose --extract-all \
  --default-domain=arrangeit --output-dir=./arrangeit/locale

Create a language directory inside locale directory, and inside that language directory create another directory with the name LC_MESSAGES. Finally, copy arrangeit translation template into that directory and rename it to arrangeit.po.

Here’s how it was done from the project’s root directory for the Croatian language:

$ mkdir -p arrangeit/locale/hr_HR/LC_MESSAGES
$ cp arrangeit/locale/arrangeit.pot arrangeit/locale/hr_HR/LC_MESSAGES/arrangeit.po

If an existing translation needs to be updated after arrangeit.pot has been changed, then you should update the differences with msgmerge:

$ msgmerge --update arrangeit/locale/hr_HR/LC_MESSAGES/arrangeit.po arrangeit/locale/arrangeit.pot

After the translation is finished, compile the language file with msgfmt:

$ cd arrangeit/locale/hr_HR/LC_MESSAGES
$ msgfmt -o arrangeit.mo arrangeit.po

If you use Poedit for translation, then instead of the last command you may create compiled file by clicking the Save button in Poedit.

black

Any code should be formatted by black before commit.

It should have been installed together with other development requirements (python -m pip install -r requirements/base_development.txt) or you may install it separately with:

$ python3 -m pip install black

Run it from the root directory by:

$ black arrangeit

pyflakes

Install pyflakes linter with:

$ python3 -m pip install pyflakes

Run it from the project’s root directory by:

$ python3 -m pyflakes arrangeit

py2deb

py2deb is used to build GNU/Linux installation package.

Run the following command to install py2deb dependencies on Debian/Ubuntu:

$ sudo apt-get install dpkg-dev fakeroot lintian python3-pip

py2deb’s dependency pip-accel needs pip version to be 7.x, so the following commands should probably be run inside a Python 3 virtual environment created for the purpose (add --user argument to pip3 if you want to install py2deb system-wide):

$ pip3 install py2deb $ pip3 install pip-accel # it will downgrade pip to version <8.0

And then run the following command inside the project’s root directory to create Debian installation package in ./dist/ directory:

$ mkdir dist
$ py2deb -r ./dist/ --no-name-prefix=arrangeit -y \
    --use-system-package=Pillow,python3-pil \
    --use-system-package=python-xlib,python3-xlib \
    --use-system-package=six,python3-six \
    .

PyInstaller

PyInstaller is used to build MS Windows installation package.

starter.py script is created in the project’s root directory for the purpose of PyInstaller’s dependencies collecting. The specification file pyinstaller.spec in the same directory is used to produce MS Windows executable by the following call:

(arrangeit) $ python -OO -m PyInstaller pyinstaller.spec

SonarQube

SonarQube is an open-source platform for inspection of code quality for detecting bugs, code smells, and security vulnerabilities.

Starting server
$ ~/opt/repos/sonarqube-7.7/bin/linux-x86-64/sonar.sh console
Starting scanner

You should add scanner executable to your PATH. For example, by adding the following line to your ~/.bashrc:

export PATH=$PATH:~/opt/repos/sonar-scanner/bin

To start scanning, run the scanner from the root directory of the project with:

$ sonar-scanner

For additional information read the scanner documentation.

Administration

Prepare coverage’s XML report by running the following in the project’s root directory:

(arrangeit) $ python -m pytest -v --cov-report xml:tests/unit/coverage-linux.xml --cov=arrangeit
Overview

Open your browser and point it to http://localhost:9000. Login as admin/admin.

Functional testing

System requirements

VirtualBox

arrangeit functional testing is done inside a VirtualBox virtual machine created with Vagrant. In Ubuntu, you may install VirtualBox by issuing the following command:

$ sudo apt-get install virtualbox virtualbox-guest-utils \
    virtualbox-guest-x11 virtualbox-guest-dkms

Vagrant

Vagrant may be downloaded from:

https://www.vagrantup.com/downloads.html

In Ubuntu, install downloaded package with:

$ sudo dpkg -i vagrant_2.2.6_x86_64.deb

Ansible

You may install Ansible in ubuntu

$ sudo apt-get install ansible

Another way is installation by pip for the current user:

$ pip install ansible --upgrade --user

Memory and disk space requirements

2GB of RAM is assigned to a virtual machine in the arrangeit Vagrantfile located in tests/vm subdirectory.

A virtual machine will occupy approximately 10GB of disk space upon finished installation, together with the size of related Vagrant box/image.

So in the case of three virtual machines you should have available at least 6GB of RAM and 30GB of disk space if you want to test them all at once. For testing one virtual machine at a time you’ll need 2GB of RAM and 10GB of disk space.

Running tests

Robot Framework functional tests for arrangeit will run automatically for every Vagrant virtual machine if you invoke the following command from the tests/vm directory:

$ vagrant up

That command will - in serial for all defined Vagrant machines - download the Vagrant box if it isn’t already downloaded, install the OS in an idempotent way and finally run the Robot Framework functional tests for arrangeit.

Run the same command with added virtual machine name if you want to run tests for a single virtual machine:

$ vagrant up xfcevm

If the provision phase has failed or you’ve updated some provisioning ansible task, then you may re-initiate provisioning with:

$ vagrant up --provision xfcevm

Maintenance and cleaning

To update downloaded Vagrant boxes to the latest available versions, you should invoke the following command:

$ vagrant box update

You may save extra space by removing the obsolete boxes with:

$ vagrant box prune

Source documentation

Contents:

arrangeit – Application package

arrangeit.__main__ – Main module of the arrangeit application

arrangeit.__main__.main()

Retrieves, instantiates and runs platform specific app.

Configures simple logger too.

arrangeit.base – Base classes holding common code for all the platforms

class arrangeit.base.BaseApp

Bases: object

Base App class holding common code for all the platforms.

Variables:
activate_root(*args)

Method must be overridden.

change_setting(name='', value=None)

Changes provided setting name to provided value

and saves it to user settings file.

If name startswith _ it means we want to change theme part, so it calls and returns change_settings_color_group().

Parameters:
  • name (str) – setting name to save
  • value (int/float/str) – setting value to save
change_settings_color_group(group='', value=None)

Changes values for all settings ending with provided group

and saves them to user settings file.

Parameters:
  • group (str) – settings group to save
  • value (int/float/str) – setting value to save
collector = None
controller = None
create_snapping_sources(for_model)

Returns collection of snapping rectangless grouped by workspace.

Snapping rectangle is created around window connected edge points pair with height (or width) of 2*SNAP_PIXELS and width (or height) of related window side. Snapping rects for all available monitors are created for each workspace.

Parameters:for_model (WindowModel) – current model
Returns:dict (int: list of four-tuples)
grab_window_screen(model, root_wid=None)

Method must be overridden.

move(*args)

Method must be overridden.

move_and_resize(*args)

Method must be overridden.

move_to_workspace(*args)

Method must be overridden.

rerun_from_window(wid, remove_before)

Restart positioning routine from the window with provided wid

without already positioned/skipped windows.

Parameters:wid (int) – windows identifier
run()

Collects data, prepare them for view and finally shows view application.

run_task(task, *args)

Runs provided task with provided args

Parameters:task (str) – task name
save_default()

Saves collection to default filename in user’s directory.

Creates application’s user data directory if it not exists.

screenshot_cleanup()

Override if platform needs cleanup after screenshot is taken.

setup_collector()

Returns platform specific Collector class.

setup_controller()

Returns platform specific Controller class.

class arrangeit.base.BaseCollector

Bases: object

Base Collector class holding common code for all the platforms.

Variables:collection – collection of WindowModel instances
add_window(win)

Method must be overridden.

check_window(win)

Method must be overridden.

collection = None
get_available_workspaces()

Method must be overridden.

get_monitors_rects()

Method must be overridden.

get_smallest_monitor_size()

Returns size of the smallest monitor.

Returns:tuple (w,h)
get_windows()

Method must be overridden.

get_workspace_number(workspace)

Method must be overridden.

get_workspace_number_for_window(win)

Method must be overridden.

is_applicable(window_type)

Method must be overridden.

is_resizable(window_type)

Method must be overridden.

is_restored(window_type)

Method must be overridden.

is_valid_state(window_type, window_state)

Method must be overridden.

run()

Populates collection with WindowModel instances

created from the windows list provided by get_windows() after they are checked for compliance with check_window() by calling add_window().

Variables:win – current window instance/handle in the loop
class arrangeit.base.BaseController(app)

Bases: object

Base Controller class holding common code for all the platforms.

Variables:
app = None
apply_snapping(new_x, new_y, sources, intersections)

Moves cursor and sets new state and corner if snapping occured on new side.

State and corner can change only for positioning phase, so for resizing phase this method just calls and returns BaseMouse.move_cursor().

Parameters:
  • new_x (int) – new cursor position on x-axis
  • new_y (int) – new cursor position on y-axis
  • sources (tuple of Rectangle) – four-tuple of root window snapping rectangles
  • intersections (tuple) – one or two pairs of snapping rectangles that intersect
Variables:

new_state – positioning state

change_position(x, y)

Changes root window position to provided x and y

if snapping criteria is not satisfied.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
change_setting(name, value)

Calls task for changing provided settings name to provided value.

Parameters:
  • name (str/int/float) – setting name
  • value – value to change the setting to
change_size(x, y)

Changes root window size in regard to provided current x and y

related to model’s changed x and y if calculated size won’t be smaller than minimum and if snapping criteria isn’t satisfied.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
Variables:
  • position – eventual position of minimum sized root
  • width – root window calculated width
  • height – root window calculated height
  • left – root window calculated position on x-axis
  • top – root window calculated position on y-axis
check_current_size(x, y)

Returns True if current size in resizing phase is greater than minimum size

defined in settings.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
Returns:

tuple position (int, int) or False

check_mouse()

Runs method that corresponds to retrieved item from mouse queue.

There are only two possibilities for item type: Boolean (scroll direction) or tuple (mouse position).

Method calls itself in regular interval defined in settings.

check_snapping(x, y)

Snaps root window and returns True if root window intersects

with any collection window according to snapping rects in current workspace or returns False if no snapping has occurred.

Calls apply_snapping() to change state and corner if snapping occurs on different corner that current state/corner.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
Variables:
  • sources – four-tuple of root window snapping rectangles
  • intersections – one or two pairs of snapping rectangles that intersect
  • offset – offset for axes
Returns:

Boolean

check_snapping_state(sources, intersections)

Returns new state changed by snapping or None if state should not be changed.

Parameters:
  • sources (tuple of Rectangle) – four-tuple of root window snapping rectangles
  • intersections (tuple) – one or two pairs of snapping rectangles that intersect
Variables:
  • new_state – positioning state
  • index0 – position of root’s first intersected snapping rectangle in sources
  • index1 – position of root’s second intersected snapping rectangle in sources
cycle_corners(counter=False)

Cycle through corners in positioning phase by changing state.

default_size = None
display_message(message, permanent=False)

Displays informational message in view’s status bar.

Variables:message – message to display
generator = None
get_root_rect(x, y)

Returns current root position and size calculated from provided x, y.

Parameters:
  • x (int) – current horizontal axis mouse position in pixels
  • y (int) – current vertical axis mouse position in pixels
Returns:

(int, int, int, int)

listed_window_activated(wid)

Calls task that restarts positioning routine from provided window id

not including windows prior to current model.

Parameters:wid (int) – windows identifier
listed_window_activated_by_digit(number)

Activates listed window by its ordinal in list presented by provided number.

Parameters:number (int) – number of 1 to 16 representing ordinal in list
Variables:windows – available workspaces in view
mainloop()

Tkinter main loop.

model = None
mouse = None
mouse_move(x, y)

Moves root Tkinter window to provided mouse coordinates.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
mouse_scroll(counter=False)

Cycles through window corners in both directions.

Parameters:counter (Boolean) – is scroll in counter direction
move_to_corner()

Configures mouse pointer and moves cursor to calculated corner position.

Variables:
  • x – absolute horizontal axis mouse position in pixels
  • y – absolute vertical axis mouse position in pixels
next(first_time=False, from_workspace=None)

Sets controller model attribute from the value yielded from generator

and populates view widgets with new model data.

Sets program to be in positioning phase by setting LOCATE state. Also changes and moves cursor and root window to model’s window position. Grabs and sets screenshot image of the model’s window. If there are no values left in collection then saves and exits app. Switches workspace if it’s changed.

Parameters:
  • first_time (Boolean) – is method called for the very first time
  • from_workspace (int) – workspace passed if listed window activated
Variables:

old_workspace – old model’s workspace number

Returns:

Boolean

on_continue(event)

Restarts positioning routine.

on_focus(event)

Calls task top activate root if Tkinter has lost focus.

on_key_pressed(event)

Calls method related to pressed key.

Parameters:event (Tkinter event) – catched event
on_mouse_left_down(event)

Calls update with current cursor position

Parameters:event (Tkinter event) – catched event
on_mouse_middle_down(event)

Switches to third state.

Parameters:event (Tkinter event) – catched event
on_mouse_right_down(event)

Skips the current model.

Parameters:event (Tkinter event) – catched event
on_resizable_change(event)

Switches model resizable attribute.

on_restored_change(event)

Switches model restored attribute.

place_on_opposite_corner()

Changes and moves cursor to model windows corner opposite to positioning phase

and so triggers master resizing.

Variables:
  • left – x-axis part of the cursor position
  • top – y-axis part of the cursor position
place_on_top_left()

Moves cursor to model’s top left position and setups that corner

widget and cursor.

prepare_view()

Populates view’s workspaces and windows list widgets.

Very first window is our main window so we skip it in listing.

recapture_mouse()

Starts mouse listener and positioning/resizing routine.

release_mouse()

Stops positioning/resizing routine and releases mouse.

remove_listed_window(wid)

Destroys window widget from windows list and refreshes the list afterward.

Parameters:wid (int) – id of window that will be destroyed
resizing_state_counterpart()

Returns resizing counterpart to current positioning state.

run(generator)

Prepares view, syncs data, starts mouse listener and enters main loop.

Calls prepare_view() to create workspaces and windows list widgets. Sets generator attribute to provided generator and sets window data by calling next() for the first time. Calls view application startup routine to show root and calculate visible parameters. Also brings global focus to root window.

save()

Runs task for saving windows collection data to default file.

screenshot = None
screenshot_when_exposed = False
screenshot_widget = None
set_default_geometry(root)

Sets provided root window width and height

calculated from available width and height for screen as quarter of the smaller element. Returned width and height have 16:9 aspect ratio.

Parameters:

root (tkinter.Tk instance) – root tkinter window

Variables:
  • width – root width in pixels
  • height – root height in pixels
set_minimum_size(x, y)

Sets root window size to minimum size defined in settings

and places root’s top left position to (x, y).

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
set_screenshot()

Creates and places screenshot of model window as background image.

If we can’t include window decoration in image then offset is returned and we place image shifted by offset amount of pixels to related axis.

Variables:offset – offset (x, y)
set_timer()

Cancels previous timer if it exists and creates a new one.

setup()

Initializes Tkinter ViewApplication with root window and self as arguments.

Creates and place screenshot widget below view frame, used to hold window image. Sets view attribute to newly created Tkinter application. Temporary hides root window. Tkinter root window from now may be accessed by self.view.master attribute.

setup_corner()

Configures mouse pointer and background to current corner.

setup_root_window(root)

Sets provided root window appearance common for all platforms.

Parameters:root (tkinter.Tk instance) – root tkinter window
shutdown()

Stops mouse listener, destroys Tkinter root window and exits.

skip_current_window()

Calls next() and then destroys that new window from the windows list.

snapping_targets = None
state = None
switch_resizable()

Changes current model resizable Boolean value and updates view.

switch_restored()

Changes current model restored Boolean value and updates view.

switch_workspace()

Activates workspace and moves root window onto it.

timer = None
update(x, y)

Calls corresponding state related update method.

Parameters:
  • x (int) – current horizontal axis mouse position in pixels
  • y (int) – current vertical axis mouse position in pixels
update_positioning(x, y)

Updates model with provided cursor position in LOCATE state

and takes action in regard to model type.

Parameters:
  • x (int) – current horizontal axis mouse position in pixels
  • y (int) – current vertical axis mouse position in pixels
update_resizing(x, y)

Updates model related to provided cursor position and current root size

and calls move and resize task if window has changed.

Switches to next model anyway.

Parameters:
  • x (int) – current horizontal axis mouse position in pixels
  • y (int) – current vertical axis mouse position in pixels
Variables:

params – rect attributes we’re going to change

view = None
workspace_activated(number)

Activates workspace with number equal to provided number.

Parameters:number (int) – our custom workspace number (screen*1000 + workspace)
workspace_activated_by_digit(number)

Activates workspace with humanized number equal to provided number.

Parameters:number (int) – number of 1 to 9 representing workspace
Variables:workspaces – available workspaces in view
class arrangeit.base.BaseMouse

Bases: object

Class responsible for listening and controlling system-wide mouse events.

Variables:
  • queue – mouse events queue
  • listener – class as separate thread listening for mouse events
  • control – class for retrieving and setting cursor position
control = None
cursor_position()

Returns current cursor position.

Returns:(int, int)
get_item()

Gets next item in queue and returns it.

Returns:(x,y) or bool or None
listener = None
move_cursor(x, y)

Moves cursor position to a point defined by provided x and y.

on_move(x, y)

Puts provided x and y in queue as position tuple.

NOTE: int(x) and int(y) are needed for Darwin - making a specific platform mouse module just for that is avoided.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
on_scroll(x, y, dx, dy)

Puts scroll direction as Boolean value in queue.

We are interested only in in dy that holds either +1 or -1 value, so we converted that to Boolean value.

Parameters:
  • x (int) – absolute horizontal axis mouse position in pixels
  • y (int) – absolute vertical axis mouse position in pixels
  • dx (int) – scroll vector on x axis
  • dy (int) – scroll vector on y axis
queue = None
start()

Initializes and starts listener for move and scroll events.

stop()

Stops listener by raising an exception.

arrangeit.data – Module with classes holding visible windows data

class arrangeit.data.WindowModel(**kwargs)

Bases: object

Class holding window data.

Variables:
changed = ()
changed_h
changed_w
changed_ws = None
changed_x
changed_y
clear_changed()

Resets changing related attributes to initial empty values.

h
icon = None
is_changed

Checks if model rect has been changed.

Returns:Boolean
is_ws_changed

Checks if workspace has been changed.

Returns:Boolean
name = None
rect = ()
resizable = None
restored = None
set_changed(**kwargs)

Creates changed attribute from provided arguments.

Accepts “rect” argument, individual rect element(s) as defined by Settings.WINDOW_MODEL_RECT_ELEMENTS or “ws” argument. If some rect part isn’t provided then changed, respectively rect is used for valid changes or rect elements.

Resets to () if any of provided rect arguments is invalid in regard to Settings.WINDOW_MODEL_TYPES for “rect”. changed_ws is reset to None in such a case.

NOTE this method needs refactoring

Variables:
  • index – argument’s index in rect tuple
  • changed – temporary collection holding calculated values
  • new_value – new value for rect element
setup(**kwargs)

Sets model data from provided kwargs

or sets the value to None/() if attribute isn’t provided.

title = None
w
wid = None
workspace = None
ws

Shorter alias for workspace attribute.

x
y
class arrangeit.data.WindowsCollection

Bases: object

Class holding visible windows collection.

add(instance)

Adds given instance to _members list.

Raises ValueError if given instance isn’t a WindowModel instance.

Parameters:instance (WindowModel instance) – window data
clear()

Empties the _members list.

export()

Prepares for saving useful data from collection.

generator()

Yields the next member from _members.

Raises ValueError if given instance isn’t a WindowModel instance. :returns: WindowModel instance

get_model_by_wid(wid)

Returns window model having provided wid from collection.

Parameters:wid (int) – window id (xid, hwnd, …)
Returns:WindowModel instance
get_windows_list()

Prepares and returns list of windows ids, titles and icons.

Returns:[(int, str, PIL.Image.Image)]
repopulate_for_wid(wid, remove_before)

Repopulates collection starting from the window with identifier wid

without including models placed before provided remove_before.

Parameters:
  • wid (int) – window id (xid, hwnd, …)
  • remove_before – window id (xid, hwnd, …)
Variables:
  • start_index – index of model that is going to become the first
  • remove_index – index of first model that is not going to be removed
size

Returns the size of _members list.

sort()

Sorts collection for presentation queue.

First model stays first and the others are sorted by their workspace first and then on current position. <starts from workspace number 0 when all the windows from greater workspaces numbers are exhausted.

Variables:
  • others – sorted list without first element
  • index – index of first element having greater or equal workspace like first

arrangeit.view – Module with classes and functions holding visual presentation data

class arrangeit.view.CornerWidget(master=None, shift=0, background='red')

Bases: object

Widget holding three frames for emphasizing current corner.

Variables:
anchor(corner=0)

Returns anchor for provided corner.

Returns:str
background = 'red'
box_size = 8
get_place_parameters(corner, size_property)

Returns parameters for place method for given corner and size method.

Returns:dict
hide_corner()

Places widget frames in provided corner.

length = 20
master = None
max_box

Returns box placement on axis related to shift.

Returns:int
max_xy

Returns placement on axis related to shift.

Returns:int
set_corner(corner=0)

Places widget frames in provided corner.

setup_widgets()

Creates all three frames and places them in default corner.

shift = 0
width = 4
class arrangeit.view.ListedWindow(master=None, wid=0, title='', icon=<PIL.Image.Image image mode=RGB size=32x32>)

Bases: tkinter.Frame

Tkinter frame holding window title and smaller icon.

Variables:
get_icon_image(icon)

Returns provided icon resized and converted to format suitable for Tkinter.

Parameters:icon (PIL.Image.Image) – window’s application icon
Returns:PIL.ImageTk.PhotoImage
icon = <PIL.Image.Image image mode=RGB size=32x32>
master = None
on_widget_enter(event)

Highlights widget by changing foreground color.

on_widget_leave(event)

Resets widget foreground color.

setup_bindings()

Binds relevant events to related callback.

setup_widgets()

Creates and places all the frame’s variables and widgets.

title = ''
wid = 0
class arrangeit.view.PropertyIcon(master=None, background='white', callback=None)

Bases: tkinter.Label

Tkinter label holding on/off image for a property.

Variables:
background = 'white'
callback = None
colorized = {0: None, 1: None}
images = {0: None, 1: None}
master = None
off_name = None
on_name = None
on_widget_enter(event)

Highlights widget by changing image and its foreground.

on_widget_leave(event)

Resets widget image and its foreground color.

set_value(value)

Sets label image in relation to provided value.

Parameters:value (Boolean) – is property on or not
setup_bindings()

Binds relevant events to related callback.

setup_widgets()

Configures widgets images and sets current image.

value = 1
class arrangeit.view.Resizable(master=None, background='white')

Bases: arrangeit.view.PropertyIcon

Widget holding resizable/non-resizable image.

Variables:
colorized = {0: None, 1: None}
images = {0: None, 1: None}
off_name = 'move.png'
on_name = 'resize.png'
class arrangeit.view.Restored(master=None, background='white')

Bases: arrangeit.view.PropertyIcon

Widget holding restored/minimized image.

Variables:
colorized = {0: None, 1: None}
images = {0: None, 1: None}
off_name = 'minimize.png'
on_name = 'restore.png'
class arrangeit.view.Statusbar(master=None)

Bases: tkinter.Frame

Tkinter frame showing app messages at the bottom of root window.

Variables:Statusbar.master – master widget
master = None
setup_widgets()

Creates and places all the widget’s variables and widgets.

class arrangeit.view.Toolbar(master=None)

Bases: tkinter.Frame

Tkinter frame holding options and quit button.

Variables:Toolbar.master – master widget
master = None
on_options_click()

Creates and shows options dialog and hides root window.

setup_widgets()

Creates and places all the frame’s variables and widgets.

class arrangeit.view.ViewApplication(master=None, controller=None)

Bases: tkinter.Frame

Tkinter frame showing current window from the data provided through controller.

Variables:
controller = None
get_root_wid()

Returns windows identifier of master/root window.

Returns:int
hide_root()

Hides master/root window.

master = None
reset_bindings()

Unbinds all relevant events and binds those for positioning routine.

setup_bindings()

Binds relevant events to related controller callbacks.

bind_all method is used if possible so events can be catch in label widget. It first unbinds Button-1 events (in case they were bound in reset_bindings())

NOTE master is None check exists solely because unit tests.

setup_corner()

Creates and places corner widget in the default corner 0.

setup_icon()

Sets and places icon label widget.

setup_name()

Sets and places application name label widget.

setup_resizable()

Sets and places resizable label widget.

setup_restored()

Sets and places restored label widget.

setup_statusbar()

Creates and places statusbar widget and sets corresponding variable.

setup_title()

Sets and places title label widget.

setup_toolbar()

Creates and places toolbar widget and sets corresponding variable.

setup_widgets()

Calls all the frame’s widgets creation and placement methods.

setup_windows()

Creates and places windows widget and sets corresponding variable.

setup_workspaces()

Creates and places workspaces widget and sets corresponding variable.

show_root()

Shows master/root window.

startup()

Shows master and then calculates and sets now visible parameters.

Calls focus_set() so frame can trigger keyboard events.

update_widgets(model)

Updates widgets with the data from provided WindowModel instance.

Tkinter needs a reference to image so we create icon_image reference.

Parameters:model (WindowModel instance) – window data
class arrangeit.view.WindowsList(master=None)

Bases: tkinter.Frame

Tkinter frame holding titles and small icons of the windows in queue.

Variables:WindowsList.master – master widget
add_windows(windows)

Creates children widgets from provided windows list.

Parameters:windows ([(int, str, PIL.Image.Image)]) – list of windows tuples (number, title, icon)
clear_list()

Destroys all children widgets.

master = None
on_window_label_button_down(event)

Activates window by wid carried with provided event.

Parameters:event (Tkinter event) – catched event
place_children()

Place children widgets in order.

Used after the top widget is destroyed.

place_widget_on_position(widget, position)

Configures placement and place provided widget at provided vertical position.

Parameters:
  • widget (ListedWindow) – Tkinter Frame widget
  • position (int) – vertical position in master starting from top
class arrangeit.view.Workspace(master=None, number=0, name='')

Bases: tkinter.Frame

Tkinter frame holding individual workspace widget.

Variables:
get_humanized_number(number)

Returns workspace number without screen part and increased by 1

as systems count workspaces from 0, but users expect to be from 1.

Parameters:number (int) – workspace number
master = None
name = ''
number = 0
on_widget_enter(event)

Highlights widget by changing foreground color.

on_widget_leave(event)

Resets widget foreground color.

setup_bindings()

Binds relevant events to related callback.

setup_widgets()

Creates and places all the frame’s variables and widgets.

As systems counts workspace from 0, we increase number by 1.

class arrangeit.view.WorkspacesCollection(master=None)

Bases: tkinter.Frame

Tkinter frame holding all the available workspaces widgets.

Variables:
active = 0
add_workspaces(workspaces)

Creates children workspaces widgets from provided list of workspaces

Creates no widget for configuration without multiple workspaces. Widgets are stacked related to their numbers from top right two positions towards bottom and then too the left, Actual workspaces are placed from left to right, then down the same orientation. Still, as a design decision, we use the same size for every configuration having less than 5 workspaces.

Parameters:workspaces ([(int, str)]) – list of workspaces two-tuples (number, name)
Variables:relwidth – workspace widget width
master = None
on_workspace_label_button_down(event)

Activates workspace by number carried with provided event.

Parameters:event (Tkinter event) – catched event
select_active(number)

Emphasizes active workspace and deemphasizes all others.

Foreground text coloured by setting SELECTED_COLOR is used to emphasize selection, together with SELECT_CURSOR setting.

Parameters:

number (int) – number of workspace to select

Variables:
  • workspace – child widget
  • color – Tkinter color name
  • cursor – Tkinter cursor name
arrangeit.view.get_screenshot_widget(root)

Returns Label widget that will hold screenshot image in background.

Parameters:root (tk.Tk) – application main window
Returns:tk.Label
arrangeit.view.get_tkinter_root()

Initializes and returns Tkinter root window.

Returns:tk.Tk window instance

arrangeit.options – Module with classes and functions for options dialog

class arrangeit.options.AboutDialog(master=None)

Bases: tkinter.Toplevel

Tkinter “About” dialog window.

Variables:
master = None
on_help_click()

Opens documentation page in user’s default web browser.

on_releases_click()

Opens download releases page in user’s default web browser.

setup_widgets()

Creates and packs all the dialog’s widgets.

class arrangeit.options.CheckOption(master=None, name='', change_callback=None, initial=False, label='')

Bases: tkinter.Checkbutton

Tkinter widget for showing and changing Boolean values.

Variables:
master = None
name = ''
on_update_value(*args)
var = None
class arrangeit.options.ColorOption(master=None, name='', change_callback=None, initial='', label='', choices=('white', 'black', 'gray', 'slategray', 'gray25', 'gray75', 'lightblue', 'blue', 'royalblue', 'cyan', 'orange', 'salmon', 'indianred', 'red', 'orchid', 'pink', 'green', 'olivedrab', 'wheat', 'khaki', 'tan', 'lightgoldenrodyellow', 'yellow'))

Bases: tkinter.OptionMenu

Tkinter widget for showing and changing Boolean values.

Variables:
label = None
master = None
name = ''
on_update_value(*args)
var = None
class arrangeit.options.FloatScaleOption(master, **kwargs)

Bases: arrangeit.options.ScaleOption

Tkinter widget for showing and changing float range settings values.

on_update_value(value)
class arrangeit.options.OptionsDialog(master=None)

Bases: tkinter.Toplevel

Tkinter dialog window for manipulating of user settings data.

Variables:
change_setting(name='', value=None)

Calls sontroller’s change setting method and updates message log.

Also cancels previous timer if it exists and create a new one.

Parameters:
  • name (str/int/float) – setting name
  • value – value for given name setting
create_frame(master)

Creates and returns frame that will holds pair of widgets.

Parameters:master (Tkinter widget) – parent widget
create_separator(master, vertical=False)

Creates and returns default horizontal separator of vertical if argument set.

Parameters:
  • master (Tkinter widget) – parent widget
  • vertical (Booleand) – is separator oriented vertical instead default horizontal
create_widget(master, name, **kwargs)

Creates and returns presentation widget for setting with provided name.

Parameters:
  • master (ttk.LabelFrame) – parent widget
  • name (str) – setting name
Returns:

Tkinter widget instance

master = None
message = None
on_destroy_options(event)

Brings back root window and destroys options dialog.

on_save_default()

Saves windows collection data to default file.

on_show_about()

Creates and shows about dialog on top of this dialog.

set_timer()

Cancels previous timer if it exists and creates a new one.

setup_bindings()

Binds relevant events to related callback.

setup_files_section()

Creates and packs widgets for section dealing with files.

Returns:ttk.LabelFrame
setup_section(name, denominator=6)

Creates and packs widgets for section with provided name.

Returns:ttk.LabelFrame
setup_widgets()

Creates and packs all the options’ widgets.

timer = None
widget_class_from_name(name)

Returns related widget class from provided setting name.

Parameters:name (str) – setting name
Returns:custom Tkinter widget instance
class arrangeit.options.ScaleOption(master=None, name='', change_callback=None, initial=0, label='', configs={})

Bases: tkinter.Scale

Tkinter widget for showing and changing range settings values.

Variables:
master = None
name = ''
on_update_value(value)
class arrangeit.options.ThemeOption(*args, **kwargs)

Bases: arrangeit.options.ColorOption

arrangeit.utils – Module holding various utility functions

class arrangeit.utils.Rectangle(x0, y0, x1, y1)

Bases: tuple

x0

Alias for field number 0

x1

Alias for field number 2

y0

Alias for field number 1

y1

Alias for field number 3

arrangeit.utils.check_intersections(sources, targets)

Returns first pairs that intersects from sources and targets list of Rectangles.

Sources is either four-tuple representing whole window or two-tuple representing specific corner of the window (from first top-left clockwise to forth bottom-left).

We are interested in intersection of odd or even pairs of sources and targets. It means that sources[0] or sources[2] should intersect with targets[n][0] or targets[n][2], respectively sources[1] or sources[3] should intersect with targets[n][1] or targets[n][3].

So we create iterator that first cycle through all even elements pairs and then through all odd elements pairs. Stops iteration when first intersected pair is found. Returns either single pair (even or odd) or tuple of both.

Parameters:
  • sources (tuple of Rectangle) – two-tuple or four-tuple of root window snapping rectangles
  • targets (list of Rectangle) – collection of other windows snapping rectangles
  • even ((Rectangle, Rectangle)) – horizontal intersection pair or False
  • odd ((Rectangle, Rectangle)) – vertical intersection pair or False
Returns:

Rectangle or (Rectangle,:class:Rectangle) or False

arrangeit.utils.get_class(name, platform)

Helper method for retrieving platform specific class instance

for given name and platform.

If provided platform is None then we use platform_path().

If class can’t be imported that means host system isn’t implemented (yet…) and so we sys.exit with a message.

Parameters:
  • name (string) – function name suffix
  • platform (string or None) – platform name
Returns:

class instance from the platform specific package

arrangeit.utils.get_component_class(name, platform=None)

Helper method for retrieving platform specific App class.

Parameters:platform (string) – platform name
Returns:class with provided name from the platform specific package
arrangeit.utils.get_cursor_name(corner, with_arrow=False)

Returns cursor name for provided corner.

Parameters:
  • corner (int) – corner number
  • with_arrow (Boolean) – indicating should cursor contain an arrow
Returns:

str

arrangeit.utils.get_prepared_screenshot(image, blur_size=2, grayscale=False)

Filters provided image and converts it to format suitable for Tkinter.

SCREENSHOT_BLUR_PIXELS defines blur depth in pixels.

Parameters:
  • image (PIL.Image.Image) – raw screenshot image
  • blur_size (int) – how many pixels in all directions will be blured
  • grayscale (Boolean) – should image be converted to grayscale
Returns:

PIL.ImageTk.PhotoImage

arrangeit.utils.get_resized_image(filename, size)

Opens and resizes image with provided filename to provided size.

Parameters:
  • filename (str) – resource file name
  • size (tuple) – width and height to resize image to
Returns:

PIL.Image

arrangeit.utils.get_resource_path(filename)

Returns full path to resource with provided filename.

Parameters:filename (str) – resource file name
Returns:str
arrangeit.utils.get_snapping_sources_for_rect(rect, snap, corner=None)

Returns snapping rectangles formated as Rectangle(x0,y0,x0,y0) from provided rect.

Snapping rectangle is created around window connected edge points pair with height (or width) of 2*SNAP_PIXELS and width (or height) of related window side.

All four rectangles are returned for default corner of None. If corner is provided then it returns two adjacent rectangles for related provided corner (horizontal first, vertical second) where ordinal 0 is top-left corner, with clockwise ordering to bottom-left corner which is ordinal 3.

Parameters:
  • rect ((int, int, int, int)) – window defined by (x, y, width, height)
  • snap (int) – snapping distance in pixels
Returns:

two or four-tuple of Rectangle

arrangeit.utils.get_value_if_valid_type(value, typ)

Returns provided value if it’s of provided type

or returns None if it’s not. If value is None then None is returned. If provided value and typ are collections then each element is checked.

Parameters:
  • value (Python type) – value to check for type
  • typ (Python type) – type to check on value
Returns:

value or None

arrangeit.utils.increased_by_fraction(value, fraction)

Helper method for increasing provided value by provided fraction.

Parameters:
  • value (int) – value to increase
  • fraction (float) – fraction of a whole to increase value by
Returns:

int

arrangeit.utils.offset_for_intersections(rectangles, snap)

Checks if single or both axes intersect and returns related offset(s).

Parameters:
  • rectangles (Rectangle or (Rectangle, Rectangle)) – one or two intersecting pair of rectangles
  • snap (int) – snapping value in pixels
Returns:

tuple (x,y)

arrangeit.utils.open_image(filename, background='white', colorized=False, foreground='red')

Returns Pillow image instance from provided name and colorizes it if set.

Provided black and white are used for colorize filter.

Parameters:
  • filename (str) – image filename
  • background (str) – image background color
  • colorized (Boolean) – should return image be highlighted
  • foreground (str) – image foreground color
Returns:

PIL.Image

arrangeit.utils.platform_path()

Returns lowercased string holding platform name.

arrangeit.utils.platform_user_data_path()

Retrieves platform specific user data directory path.

arrangeit.utils.quarter_by_smaller(width, height, size=3)

Helper method for retrieving one-forth (default) for given width and height

with aspect ratio of 16:9.

Starting point for calculation is the smaller value - the presumption is that monitors could be stacked in left-to-right or top-to-bottom manner.

Parameters:
  • width (int) – total desktop area width
  • height (int) – total desktop area height
  • size (int) – window size from 1 to 4
Variables:

denominator – window size denominator from 6 to 3

Returns:

(int, int)

arrangeit.utils.set_icon(widget)

Sets application icon to provided widget window.

Parameters:widget (tk.Toplevel or tk.Tk) – Tkinter toplevel widget

arrangeit.settings – Module holding program’s constants and settings

class arrangeit.settings.Settings

Bases: object

Class holding all the program’s constants and settings.

BLANK_ICON = <PIL.Image.Image image mode=RGB size=32x32>
CORNER_RECT_INDEXES = [(0, 3), (0, 1), (2, 1), (2, 3)]
HELP_PAGE_URL = 'https://arrangeit.readthedocs.io/en/latest/userguide.html'
ICON_SIZE = 32
LOCATE = 0
OTHER = 100
RELEASES_PAGE_URL = 'https://github.com/ipaleka/arrangeit/releases'
RESIZE = 10
WINDOW_MODEL_RECT_ELEMENTS = ('x', 'y', 'w', 'h')
WINDOW_MODEL_TYPES = {'icon': <class 'PIL.Image.Image'>, 'name': <class 'str'>, 'rect': (<class 'int'>, <class 'int'>, <class 'int'>, <class 'int'>), 'resizable': <class 'bool'>, 'restored': <class 'bool'>, 'title': <class 'str'>, 'wid': <class 'int'>, 'workspace': <class 'int'>}
classmethod color_group(group)

Returns all the Settings members which names end with provided name.

Parameters:group (str) – setting name
Returns:list
classmethod is_setting(name, value)

Returns True if provided name with value is valid setting.

Parameters:
  • name (str) – setting name
  • value (str/int/float) – value to check type for
Returns:

Boolean

classmethod setting_type(name)

Returns type of setting with provided name.

Parameters:name (str) – setting name
Returns:type
user_settings = {}
class arrangeit.settings.SettingsMetaclass

Bases: type

Meta class needed to access Settings class attributes by names.

arrangeit.settings.read_user_settings()

Reads and returns user settings data from user home directory.

Returns:dict
arrangeit.settings.validate_user_settings()

Reads, validates and returns dictionary of user settings.

Returns:dict {name: value}

arrangeit.darwin – Subpackage holding code specific to Mac OS platform

arrangeit.darwin.app – Module providing and running main app loop (Mac OS platform specific code)
class arrangeit.darwin.app.App

Bases: arrangeit.base.BaseApp

Main app class with Mac OS specific code.

activate_root(wid)

TODO implement

Parameters:wid (int) – windows id
grab_window_screen(model, root_wid=None)

Grabs and returns screenshot of the window from provided model.

TODO implement

Parameters:
  • model (WindowModel) – model of the window we want screenshot from
  • root_wid (int) – root window identifier
Returns:

(PIL.ImageTk.PhotoImage, (int, int))

move(wid)

TODO implement

Parameters:wid (int) – windows id
move_and_resize(wid)

Moves and resizes window identified by provided identifier wid.

TODO implement

Parameters:wid (int) – windows id
Returns:Boolean
move_to_workspace(wid, number)

TODO implement

Parameters:
  • wid (int) – root id got from Tkinter
  • number (int) – our custom workspace number
arrangeit.darwin.collector – Module responsible for collecting windows (Mac OS platform specific code)
class arrangeit.darwin.collector.Collector

Bases: arrangeit.base.BaseCollector

Collecting windows class with Mac OS specific code.

add_window(win)

Creates WindowModel instance from provided win and adds it to collection.

Parameters:win (dict) – window object
check_window(win)

Checks does window qualify to be collected

by checking window type applicability with is_applicable() and its current state validity with is_valid_state().

Parameters:win (dict) – window object
Returns:Boolean
get_application_name(win)

Returns application/owner name for the provided win.

Parameters:win (dict) – window object
Returns:str
get_available_workspaces()

TODO implement

Returns:list
get_monitors_rects()

Returns list of available monitors position and size rectangles.

Returns:list [(x,y,w,h)]
get_windows()

Returns list of all windows as dictionary objects

Returns:list
get_workspace_number_for_window(win)

TODO implement

Parameters:win (dict) – window object
Returns:str
is_applicable(win)

Checks if provided win represents window that should be collected.

TODO implement

Parameters:win (dict) – window object
Returns:Boolean
is_resizable(win)

TODO implement

Parameters:win (dict) – window object
Returns:Boolean
is_restored(win)

TODO implement

Parameters:win (dict) – window object
Returns:Boolean
is_valid_state(win)

Checks if provided win is window with valid state for collecting.

TODO implement

Parameters:win (dict) – window object
Returns:Boolean
arrangeit.darwin.controller – Module responsible for connecting data and view (Mac OS platform specific code)
class arrangeit.darwin.controller.Controller(app)

Bases: arrangeit.base.BaseController

Controller class with Mac OS specific code.

arrangeit.darwin.utils – Mac OS specific utility functions
arrangeit.darwin.utils.user_data_path()

Returns Mac OS X specific path for saving user’s data.

arrangeit.linux – Subpackage holding code specific to GNU/Linux platform

arrangeit.linux.app – Module providing and running main app loop (GNU/Linux platform specific code)
class arrangeit.linux.app.App

Bases: arrangeit.base.BaseApp

Main app class with GNU/Linux specific code.

activate_root(wid)

Activates/focuses root window identified by provided wid.

Parameters:wid (int) – windows id
grab_window_screen(model, root_wid=None)

Grabs and returns screenshot of the window from provided model.

We can’t include window decoration in image so offset in pixels for both axes is returned.

Parameters:
  • model (WindowModel) – model of the window we want screenshot from
  • root_wid (int) – root window identifier - not needed for GNU/Linux
Variables:
  • window – model window instance
  • pixbuf – X11 pixbuf image
  • width – window width in pixels without window manager decoration
  • height – window height in pixels without window manager decoration
Returns:

(PIL.ImageTk.PhotoImage, (int, int))

move(wid)

Just calls move_and_resize() as the same method moves and resizes

in Wnck.Window class under GNU/Linux.

Parameters:wid (int) – windows id
Returns:Boolean
move_and_resize(wid)

Moves and resizes window identified by provided wid.

Gravity stays the same (Wnck.WindowGravity.CURRENT) and the other arguments are calculated/retrieved from model where changed attribute holds needed data.

If returned mask is False then wee don’t need to do anything more.

Parameters:

wid (int) – windows id

Variables:
  • model – window data
  • mask – combination of bits holding information what is changed
  • win – window instance
Returns:

Boolean

move_to_workspace(wid, number)

Moves root window to provided custom workspace number.

Calls _move_window_to_workspace() with wid increased by 1.

Parameters:
  • wid (int) – root id got from Tkinter
  • number (int) – our custom workspace number
arrangeit.linux.collector – Module responsible for collecting windows (GNU/Linux platform specific code)
class arrangeit.linux.collector.Collector

Bases: arrangeit.base.BaseCollector

Collecting windows class with GNU/Linux specific code.

add_window(win)

Creates WindowModel instance from provided win and adds it to collection.

Parameters:win (Wnck.Window object) – window to create WindowModel from it
check_window(win)

Checks does window qualify to be collected

by checking window type applicability with is_applicable() and its state validity for the type with is_valid_state().

Parameters:

win (Wnck.Window object) – window instance to check

Variables:
  • window_type – window type
  • window_state – window state
Returns:

Boolean

get_available_workspaces()

Returns custom list of workspaces available on default screen.

Returned list contains two-tuples of calculated workspace number and corresponding name.

Variables:workspaces – workspaces collection
Returns:[(int, str)]
get_image_from_pixbuf(pixbuf)

Returns PIL image converted from provided pixbuf.

https://gist.github.com/mozbugbox/10cd35b2872628246140

Returns:PIL.Image instance
get_monitors_rects()

Returns list of available monitors position and size rectangles.

Variables:
  • display – default display
  • area – monitor working area rect
Returns:

list [(x,y,w,h)]

get_window_by_wid(wid)

Returns window instance having provided wid.

Parameters:wid (int) – window id
Returns:Wnck.Window object
get_window_move_resize_mask(model)

Returns flag indicating what is changed when we move/resize window.

Calls recursive method traversing all rect parts. Returned flag is combination of the X, Y, WIDTH and HEIGHT bits.

Parameters:model (WindowModel instance) – model holding window data
Returns:flag
get_windows()

Returns windows list from the Wnck.Screen object.

Variables:screen – provides all the windows instances
Returns:list of Wnck.Window instances
get_wnck_workspace_for_custom_number(number)

Returns Wnck.Workspace instance from provided custom number.

Variables:number – our custom workspace number
get_workspace_number(workspace)

Returns integer containing screen and workspace numbers of the workspace.

In returned integer screen number represents thousands part, and workspace number represents remainder of division by 1000.

Parameters:workspace (Wnck.workspace) – workspace instance
Returns:int
get_workspace_number_for_window(win)

Returns workspace number for the provided window.

Parameters:win (Wnck.Window) – window instance
Returns:int
is_applicable(window_type)

Checks if provided window_type qualifies window for collecting.

Parameters:window_type (Wnck.WindowType int flag) – type of window
Returns:Boolean
is_resizable(window_type)

Checks if provided window_type implies that window is resizable.

Parameters:window_type (Wnck.WindowType int flag) – type of window
Returns:Boolean
is_restored(win)

Checks if provided win is not minimized.

Parameters:win (Wnck.Window object) – window instance to check
Returns:Boolean
is_valid_state(window_type, window_state)

Checks if window state for window_type qualifies window to collect.

Parameters:
  • window_type (Wnck.WindowType int flag) – type of window
  • window_state (Wnck.WindowState int flag) – current state of window
Returns:

Boolean

arrangeit.linux.controller – Module responsible for connecting data and view (GNU/Linux platform specific code)
class arrangeit.linux.controller.Controller(app)

Bases: arrangeit.base.BaseController

Controller class with GNU/Linux specific code.

setup_root_window(root)

Sets provided root appearance attributes specific for GNU/Linux.

arrangeit.linux.utils – GNU/Linux specific utility functions
arrangeit.linux.utils.user_data_path()

Returns GNU/Linux platform specific path for saving user’s data.

It first try with .local/share in user home directory, and if there’s no such directory returns .arrangeit directory in user home directory.

Returns:str path

arrangeit.windows – Subpackage holding code specific to MS Windows platform

arrangeit.windows.app – Module providing and running main app loop (MS Windows platform specific code)
class arrangeit.windows.app.App

Bases: arrangeit.base.BaseApp

Main app class with MS Windows specific code.

activate_root(hwnd)

Activates/focuses root window identified by provided hwnd.

grab_window_screen(model, root_wid=None)

Setups and returns screenshot of the window from provided model.

If DWM composition settings allows then surface of model window is taken from root window after thumbnails are created in it.

TODO check why this (-1, -1) fits

Parameters:
  • model (WindowModel) – model of the window we want screenshot from
  • root_wid (int) – root window identifier
Returns:

(PIL.ImageTk.PhotoImage, (int, int))

move(hwnd)

Just calls move_and_resize() as the same method moves and resizes

under MS Windows.

Parameters:hwnd (int) – windows id
move_and_resize(hwnd)

Moves and resizes window identified by provided hwnd.

Parameters:hwnd (int) – root id got from Tkinter
Variables:model – collected window data
Returns:Boolean
move_other_to_workspace(hwnd, number)

Moves other process’ window to provided workspace number.

Parameters:
  • hwnd (int) – identifier of the window to move
  • number (int) – workspace number
move_to_workspace(hwnd, number)

Moves root window to provided workspace number.

Parameters:
  • hwnd (int) – root id got from Tkinter
  • number (int) – workspace number
screenshot_cleanup(*args)

Unregisters DWM thumbnails kept in instance’s thumbnails attribute.

Variables:thumbnail – DWM thumbnail identifier
thumbnails = ()
arrangeit.windows.api – Module providing helper class and functions for API calls (MS Windows platform specific code)
class arrangeit.windows.api.Api

Bases: object

Helper class for calls to Windows API.

Variables:
  • packages – cached collection of packages distincted by windows handles
  • helpers – object holding helper methods for Windows API functions
  • Api.vdi – object holding methods of virtual desktop interface
enum_windows(hwnd=None, enum_children=False)

Helper function to enumerate either desktop windows or children windows

for window identified by provided hwnd.

Parameters:
  • hwnd (int) – window id
  • enum_children (Boolean) – should children windows be enumerated
Returns:

list

executable_name_for_hwnd(hwnd)

Returns name of the executable associated with provided window identifier.

Parameters:

hwnd (int) – window handle

Variables:
  • pid – process identifier
  • hprocess – process handle
  • path_buffer – buffer holding executable path
  • ret_val – function returned value indicating success for value > 0
Returns:

str

extended_frame_rect(hwnd)

Helper function to return DWM frame rect for window with provided hwnd.

Parameters:

hwnd (int) – window id

Variables:
  • winrect – area of window extended bounds
  • ret_val – function returned value indicating success for value > 0
Returns:

int

get_ancestor_by_type(hwnd, ancestor_type)

Helper function to return hwnd of ancestor window of window with given hwnd.

Parameters:
  • hwnd (int) – window id
  • ancestor_type (int) – window ancestor type
Returns:

int

get_desktop_ordinal_for_window(hwnd)

Returns corresponding desktop ordinal of the window with provided hwnd.

Parameters:hwnd (int) – window id
Returns:int
get_desktops()

Returns list of virtual desktops.

Returned list contains two-tuples of desktop numbers in order and their corresponding names. A name is formatted from “Desktop ” translation forllowed by ordinal increased by 1.

Returns:[(int, str)]
get_last_active_popup(hwnd)

Helper function to return hwnd of last popup of window with provided hwnd.

Parameters:hwnd (int) – window id
Returns:int
get_package(hwnd)

Returns Package holding needed package data from provided window id.

Parameters:

hwnd (int) – window id

Variables:
  • full_name – buffer holding package full name
  • package_info_reference – reference to package info structure pointer
  • package_info_buffer – buffer holding reference to package info structure
  • package_info – structure holding package data
Returns:

Package

helpers = None
is_cloaked(hwnd)

Returns True if window with provided hwnd is cloaked/hidden.

False is returned for Windows 7 and earlier versions (helper method returns error value).

If DWM value confirms cloaked state, then the value from a call to is_window_in_current_desktop is returned as all the windows from the other desktops are presented as cloaked, so it is implied they are really cloaked. NOTE this behaviour needs additional testing

Parameters:

hwnd (int) – window id

Variables:
  • cloaked – flag holding non-zero value if window is cloaked
  • ret_val – function returned value indicating error/success status
Returns:

Boolean

is_dwm_composition_enabled()

Helper function returning True if DWM composition is enabled in system.

Variables:enabled – composition enabled or not value
Returns:Boolean
move_other_window_to_desktop(hwnd, number)

Moves other window with provided hwnd to desktop with provided ordinal.

Parameters:
  • hwnd (int) – window id
  • number (int) – desktop ordinal
Returns:

int

move_own_window_to_desktop(hwnd, number)

Moves own/root window with provided hwnd to desktop with provided ordinal.

Parameters:
  • hwnd (int) – window id
  • number (int) – desktop ordinal
Returns:

int

packages = {}
setup_thumbnail(from_hwnd, root_hwnd, rectangle)

Create, updates and returns handle of thumbnail of provided source window

created in root window.

Parameters:
  • from_hwnd (int) – identifier of window to make thumbnail of
  • root_hwnd (int) – identifier of root window to make thumbnail in
  • rectangle (arrangeit.utils.Rectangle) – area occupied by thumbnail
Variables:
  • thumbnail_id – id of created thumbnail
  • ret_val – function returned value indicating error/success status
Returns:

ctypes.wintypes.HANDLE

title_info_state(hwnd, state)

Helper function to return title bar info state for window with provided hwnd.

Parameters:
  • hwnd (int) – window id
  • state (int) – title bar info state type
Variables:
  • title_info – title bar information structure
  • success – value indicating is call successful
Returns:

int

unregister_thumbnail(thumbnail_id)

Unregisters thumbnail with provided identifier.

Parameters:thumbnail_id (ctypes.wintypes.HANDLE) – identifier of thumbnail to unregister
Variables:ret_val – function returned value indicating error/success status
Returns:ctypes.wintypes.HANDLE
vdi = None
window_info_extended_style(hwnd, style)

Helper function to return extended window style for window with given hwnd.

Parameters:
  • hwnd (int) – window id
  • style (int) – extended window style type
Variables:
  • window_info – window information structure
  • success – value indicating is call successful
Returns:

int

class arrangeit.windows.api.DummyVirtualDesktops

Bases: object

Helper class for systems that don’t support virtual desktops.

get_desktops(refresh=False)

Returns list with single two-tuple of 0 and empty string.

get_window_desktop(hwnd, refresh=False)

Returns two-tuple of 0 and empty string.

is_window_in_current_desktop(hwnd)

Just returns True.

move_other_window_to_desktop(hwnd, desktop_ordinal)

Just returns None.

move_own_window_to_desktop(hwnd, desktop_ordinal)

Just returns None.

class arrangeit.windows.api.Helpers

Bases: object

Helper class for calls to WinDLL API.

class arrangeit.windows.api.Package(path='')

Bases: object

Helper class for calls to Windows API.

Variables:
  • path – filesystem path to package directory
  • app_name – name of package’s first application
  • Package.icon – application icon
app_name = ''
icon = <PIL.Image.Image image mode=RGB size=32x32>
path = ''
setup_package()

Retrieves and sets package data.

TODO add call to this method after window is exposed if it was minimized

Variables:root – root element of XML document
arrangeit.windows.api.platform_supports_packages()

Returns Boolean indicating if Windows version supports packages.

Variables:version – platform version data
Returns:Boolean
arrangeit.windows.api.platform_supports_virtual_desktops()

Returns Boolean indicating if Windows version supports virtual desktops.

Variables:version – platform version data
Returns:Boolean
arrangeit.windows.collector – Module responsible for collecting windows (MS Windows platform specific code)
class arrangeit.windows.collector.Collector

Bases: arrangeit.base.BaseCollector

Collecting windows class with MS Windows specific code.

add_window(hwnd)

Creates WindowModel instance from provided hwnd and adds it to collection.

Parameters:hwnd (int) – window id
check_window(hwnd)

Checks does window qualify to be collected

by checking window type applicability with is_applicable() and its current state validity with is_valid_state().

Parameters:hwnd (int) – window id
Returns:Boolean
get_application_name(hwnd)

Returns application name for the window represented by provided handle.

For Windows versions greater than 8.1 it uses package app_name if there’s cached package for provided hwnd.

Otherwise it tries to extract the name from executable path.

If previous methods haven’t succeed it returns window’s class name.

Parameters:
  • hwnd (int) – window id
  • app_name (str) – executable name without extension
Returns:

str

get_available_workspaces()

Returns custom list of workspaces available on default screen.

Returned list contains two-tuples of workspace number in order and corresponding name.

Returns:[(int, str)]
get_monitors_rects()

Returns list of available monitors position and size rectangles.

Returns:list [(x,y,w,h)]
get_windows()

Creates and returns list of all the windows handles

Returns:list of integers
get_workspace_number_for_window(hwnd)

Returns workspace number for the window with provided hwnd.

Parameters:hwnd (int) – window id
Returns:int
is_applicable(hwnd)

Checks if provided hwnd represents window type that should be collected.

Parameters:hwnd (int) – window id
Returns:Boolean
is_resizable(hwnd)

Checks if provided hwnd represents window that can be resized.

Parameters:hwnd (int) – window id
Returns:Boolean
is_restored(hwnd)

Checks if provided hwnd represents window that is not minimized.

Parameters:hwnd (int) – window id
Returns:Boolean
is_valid_state(hwnd)

Checks if provided hwnd represents window with valid state for collecting.

Checking just _is_activable() for now.

Parameters:hwnd (int) – window id
Returns:Boolean
arrangeit.windows.controller – Module responsible for connecting data and view (MS Windows platform specific code)
class arrangeit.windows.controller.Controller(app)

Bases: arrangeit.base.BaseController

Controller class with MS Windows specific code.

screenshot_when_exposed = True
setup_root_window(root)

Sets provided root appearance attributes specific for MS Windows.

arrangeit.windows.vdi – Virtual desktop interfaces for MS Windows

Code from this module is based on the blog <http://www.cyberforum.ru/blogs/105416/blog3671.html>. The Python implementation is based on the work by @kdschlosser <https://github.com/DanEdens/Virtual_Desktops_Plugin/blob/master/Virtualdesktops/__int__.py> (<http://www.eventghost.net>, <http://www.eventghost.net/forum/viewtopic.php?p=53308#p53308>)

class arrangeit.windows.vdi.IApplicationView(*args, **kwargs)

Bases: arrangeit.windows.vdi.IInspectable

Interface that provides view for the top-level application information.

class arrangeit.windows.vdi.IApplicationViewCollection(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Interface to collection of application views for specified data group.

class arrangeit.windows.vdi.IApplicationViewConsolidatedEventArgs(*args, **kwargs)

Bases: arrangeit.windows.vdi.IInspectable

Interface providing the results of application view consolidation operations.

class arrangeit.windows.vdi.IInspectable(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Interface that provides functionality required for all Windows Runtime classes.

class arrangeit.windows.vdi.IObjectArray(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Interface for accessing collection of objects based on IUnknown interface.

class arrangeit.windows.vdi.IServiceProvider(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Interface that provides custom support to other objects.

class arrangeit.windows.vdi.IVirtualDesktop(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Class defining virtual desktop instance accessible through its pointer.

class arrangeit.windows.vdi.IVirtualDesktopManager(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Interface to publicly documented methods dealing with virtual dektops.

class arrangeit.windows.vdi.IVirtualDesktopManagerInternal(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Interface to methods dealing with virtual dektops documented by community.

class arrangeit.windows.vdi.VirtualDesktopsWin10

Bases: object

Helper class for calls to Windows 10 virtual desktop interfaces.

IVirtualDesktopManager is an interface publicly documented by Microsoft, whilst IVirtualDesktopManagerInternal is documented by community.

Variables:
  • manager – interface to publicly available API for virtual desktops
  • internal_manager – interface to internal API for virtual desktops
  • view_collection – interface to application views collection
  • desktops – collection of virtual desktops ordinals and uids
desktops = None
get_desktops(refresh=False)

Returns virtual desktops collection available in the system.

Retrieves and sets instance attribute holding collection if it hasn’t been set yet or if True value is provided as refresh argument.

Parameters:refresh (Boolean) – value indicating if desktop collection should be refreshed
Returns:list of (int, GUID)
get_window_desktop(hwnd, refresh=False)

Returns virtual desktop where window with provided hwnd is placed.

Parameters:
  • hwnd (int) – window handle
  • refresh (Boolean) – value indicating if desktop collection should be refreshed
Variables:

desktop_id – virtual desktop’s uid representation

Returns:

(int, GUID)

internal_manager = None
is_window_in_current_desktop(hwnd)

Checks if window with provided hwnd is placed in current desktop.

Parameters:hwnd (int) – window handle
Returns:Boolean
manager = None
move_other_window_to_desktop(hwnd, desktop_ordinal)

Moves other process’ window with provided hwnd to the other desktop

identified by desktop_ordinal.

Parameters:
  • hwnd (int) – window handle
  • desktop_ordinal (int) – virtual desktop ordinal in desktops collection
Variables:
  • desktop_id – virtual desktop’s uid representation
  • desktop – virtual desktop instance
  • app_view – interface to application view
Returns:

False on success, None on failure

move_own_window_to_desktop(hwnd, desktop_ordinal)

Moves root window with provided hwnd to the desktop with provided ordinal.

Parameters:
  • hwnd (int) – window handle
  • desktop_ordinal (int) – virtual desktop ordinal in desktops collection
Variables:
  • desktop_id – virtual desktop’s uid representation
  • desktop – virtual desktop instance
Returns:

False on success, None on failure

view_collection = None
arrangeit.windows.utils – MS Windows specific utility functions
arrangeit.windows.utils.extract_name_from_bytes_path(path)

Returns name without directory structure and extension from given path.

Parameters:path (bytes) – full path to file
Returns:str
arrangeit.windows.utils.user_data_path()

Returns MS Windows specific path for saving user’s data.

tests – Unit and integration tests

tests.unit – arrangeit unit tests package

tests.unit.test_setup – Unit tests for main app setup and configuration
class tests.unit.test_setup.TestFiles

Bases: object

Testing class for program resources files.

test_resources_icon_file_exist(asset)
test_resources_misc_file_exist(asset)
class tests.unit.test_setup.TestSetup

Bases: object

Testing class for main app initialization and configuration.

test_main_calls_App_run(mocker)
test_main_calls_get_component_class_App(mocker)
test_main_calls_logging_basicConfig(mocker)
test_main_initializes_platform_specific_App(mocker)
class tests.unit.test_setup.TestStructure

Bases: object

Testing class for platform specific subpackages structure.

test_host_platform_App_issubclass_of_BaseApp()
test_host_platform_Collector_issubclass_of_BaseCollector()
test_host_platform_Controller_issubclass_of_BaseController()
tests.unit.test_base – Unit tests for base classes (without BaseController)
class tests.unit.test_base.TestBaseApp

Bases: object

Testing class for BaseApp class.

test_BaseApp__initialize_snapping_sources_calls_collector_get_monitors_rects(mocker)
test_BaseApp__initialize_snapping_sources_calls_get_available_workspaces(mocker)
test_BaseApp__initialize_snapping_sources_calls_get_snapping_sources_for_rect(mocker)
test_BaseApp__initialize_snapping_sources_functionality(mocker)
test_BaseApp__save_setting_calls_json_load_once(mocker)
test_BaseApp__save_setting_calls_platform_user_data_path(mocker)
test_BaseApp__save_setting_catches_exception_and_continues(mocker)
test_BaseApp__save_setting_checks_if_directory_exists(mocker)
test_BaseApp__save_setting_checks_if_file_exists(mocker)
test_BaseApp__save_setting_creates_directory(mocker)
test_BaseApp__save_setting_overwrites_settings_file_values(mocker)
test_BaseApp__save_setting_updates_settings_file(mocker)
test_BaseApp__save_setting_writes_to_settings_file(mocker)
test_BaseApp_activate_root_raises_NotImplementedError(mocker)
test_BaseApp_change_setting_calls__save_setting(mocker)
test_BaseApp_change_setting_calls_is_setting(mocker)
test_BaseApp_change_setting_calls_is_setting_invalid(mocker)
test_BaseApp_change_setting_changes_valid_setting(mocker)
test_BaseApp_change_setting_returns_change_settings_color_group_BG(mocker)
test_BaseApp_change_setting_returns_change_settings_color_group_FG(mocker)
test_BaseApp_change_settings_color_group_calls_Settings_color_group(mocker)
test_BaseApp_change_settings_color_group_calls_Settings_setattr(mocker)
test_BaseApp_change_settings_color_group_calls__save_setting(mocker)
test_BaseApp_create_snapping_sources_calls__initialize_snapping_sources(mocker)
test_BaseApp_create_snapping_sources_calls_collection_generator(mocker)
test_BaseApp_create_snapping_sources_calls_utils_get_snapping_sources_for_rect(mocker)
test_BaseApp_create_snapping_sources_excludes_provided_model(mocker, windows, expected)
test_BaseApp_create_snapping_sources_functionality(mocker, windows, expected)
test_BaseApp_create_snapping_sources_includes_provided_model(mocker, windows, expected)
test_BaseApp_create_snapping_sources_returns_dict(mocker)
test_BaseApp_create_snapping_sources_uses_changed_values_if_available(mocker, windows, expected)
test_BaseApp_defines_screenshot_cleanup()
test_BaseApp_grab_window_screen_raises_NotImplementedError(mocker)
test_BaseApp_initialization_calls_setup_collector(mocker)
test_BaseApp_initialization_calls_setup_controller(mocker)
test_BaseApp_initialization_instantiates_collector(mocker)
test_BaseApp_initialization_instantiates_controller(mocker)
test_BaseApp_initialization_instantiates_controller_with_app(mocker)
test_BaseApp_inits_attr_as_None(attr)
test_BaseApp_move_and_resize_raises_NotImplementedError(mocker)
test_BaseApp_move_raises_NotImplementedError(mocker)
test_BaseApp_move_to_workspace_raises_NotImplementedError(mocker)
test_BaseApp_rerun_from_window_calls_repopulate_for_wid(mocker)
test_BaseApp_run_calls_WindowsCollection_generator(mocker)
test_BaseApp_run_calls_collector_run(mocker)
test_BaseApp_run_calls_controller_run(mocker)
test_BaseApp_run_calls_controller_run_with_valid_argument(mocker)
test_BaseApp_save_default_calls_collection_export(mocker)
test_BaseApp_save_default_calls_json_dump(mocker)
test_BaseApp_save_default_calls_platform_user_data_path(mocker)
test_BaseApp_save_default_checks_if_directory_exists(mocker)
test_BaseApp_save_default_creates_directory(mocker)
test_BaseApp_screenshot_cleanup_returns_None(mocker)
test_BaseApp_setup_collector_calls_get_component_class_Collector(mocker)
test_BaseApp_setup_controller_calls_get_component_class_Controller(mocker)
class tests.unit.test_base.TestBaseCollector

Bases: object

Testing class for base Collector class.

test_BaseCollector_add_window_raises_NotImplementedError()
test_BaseCollector_check_window_raises_NotImplementedError()
test_BaseCollector_get_available_workspaces_raises_NotImplementedError()
test_BaseCollector_get_monitors_rects_raises_NotImplementedError()
test_BaseCollector_get_smallest_monitor_size_calls_get_monitors_rects(mocker)
test_BaseCollector_get_smallest_monitor_size_returns_two_tuple(mocker)
test_BaseCollector_get_windows_raises_NotImplementedError()
test_BaseCollector_get_workspace_number_for_window_raises_NotImplementedError()
test_BaseCollector_get_workspace_number_raises_NotImplementedError()
test_BaseCollector_initialization_instantiates_WindowsCollection(mocker)
test_BaseCollector_inits_collection_as_None()
test_BaseCollector_is_applicable_raises_NotImplementedError()
test_BaseCollector_is_resizable_raises_NotImplementedError()
test_BaseCollector_is_restored_raises_NotImplementedError()
test_BaseCollector_is_valid_state_raises_NotImplementedError()
test_BaseCollector_run_calls_add_window(mocker, elements)
test_BaseCollector_run_calls_check_window(mocker)
test_BaseCollector_run_calls_collection_sort(mocker)
test_BaseCollector_run_calls_get_windows(mocker)
class tests.unit.test_base.TestBaseMouse

Bases: object

Testing class for Mouse class methods.

test_BaseMouse_cursor_position_calls_Controller_position(mocker)
test_BaseMouse_cursor_position_returns_position(mocker)
test_BaseMouse_get_item_calls_queue_get(mocker)
test_BaseMouse_get_item_returns_None_for_Empty(mocker)
test_BaseMouse_get_item_returns_item(mocker)
test_BaseMouse_init_instantiates_Controller(mocker)
test_BaseMouse_init_instantiates_Queue(mocker)
test_BaseMouse_init_sets_control_attribute(mocker)
test_BaseMouse_init_sets_queue_attribute(mocker)
test_BaseMouse_inits_attr_as_None(attr)
test_BaseMouse_move_cursor_calls_Controller_position(mocker)
test_BaseMouse_move_cursor_calls_position_with_provided_x_and_y(mocker)
test_BaseMouse_on_move_puts_in_queue(mocker)
test_BaseMouse_on_scroll_puts_in_queue(mocker, dy, expected)
test_BaseMouse_start_instantiates_Listener(mocker)
test_BaseMouse_start_sets_listener_attribute(mocker)
test_BaseMouse_start_starts_listener(mocker)
test_BaseMouse_stop_returns_False(mocker)
test_BaseMouse_stop_stops_listener(mocker)

StopException is raised if MagicMock has got StopException attribute.

tests.unit.test_basecontroller_domain_logic – Unit tests for domain logic part of the BaseController class
class tests.unit.test_basecontroller_domain_logic.TestBaseControllerDomainLogic

Bases: object

Testing class for base Controller class’ domain logic methods.

test_BaseController_apply_snapping_calls_check_snapping_state(mocker)
test_BaseController_apply_snapping_calls_move_cursor_for_RESIZE(mocker)
test_BaseController_apply_snapping_calls_setup_corner(mocker)
test_BaseController_apply_snapping_changes_move_cursor_call(mocker, new_state, state, added_x, added_y)
test_BaseController_apply_snapping_changes_state(mocker)
test_BaseController_apply_snapping_not_calling_setup_corner(mocker)
test_BaseController_check_snapping_calls_apply_snapping(mocker)
test_BaseController_check_snapping_calls_check_intersection(mocker)
test_BaseController_check_snapping_calls_get_root_rect(mocker)
test_BaseController_check_snapping_calls_get_snapping_sources_for_locate(mocker)
test_BaseController_check_snapping_calls_get_snapping_sources_for_resize(mocker)
test_BaseController_check_snapping_calls_offset_for_intersections(mocker)
test_BaseController_check_snapping_not_calling_apply_snapping(mocker)
test_BaseController_check_snapping_snapping_is_on_false(mocker)
test_BaseController_check_snapping_state_returns_None_for_both_axes_snapping(mocker)
test_BaseController_check_snapping_state_returns_None_for_single_axis_snapping(mocker)
test_BaseController_check_snapping_state_returns_state_for_both_axes_snapping(mocker)
test_BaseController_check_snapping_state_returns_state_for_single_axis_snapping(mocker)
test_BaseController_listed_window_activated_calls_display_message(mocker)
test_BaseController_listed_window_activated_calls_next(mocker)
test_BaseController_listed_window_activated_calls_recapture_mouse_for_OTHER(mocker)
test_BaseController_listed_window_activated_calls_task_rerun_from_window(mocker)
test_BaseController_listed_window_activated_calls_windows_clear_list(mocker)
test_BaseController_listed_window_activated_calls_windowslist_add_windows(mocker)
test_BaseController_listed_window_activated_initializes_generator(mocker)
test_BaseController_listed_window_activated_not_calling_recapture_not_OTHER(mocker, state)
test_BaseController_listed_window_activated_sets_generator_attr(mocker)
test_BaseController_next_calls_create_snapping_sources(mocker)
test_BaseController_next_calls_get_root_rect_for_first_time_True(mocker)
test_BaseController_next_calls_place_on_top_left(mocker)
test_BaseController_next_calls_remove_listed_window(mocker)
test_BaseController_next_calls_root_geometry_for_first_time_True(mocker)
test_BaseController_next_calls_save_on_StopIteration(mocker)
test_BaseController_next_calls_set_default_geometry(mocker)
test_BaseController_next_calls_set_screenshot(mocker)
test_BaseController_next_calls_shutdown_on_StopIteration(mocker)
test_BaseController_next_calls_switch_workspace_from_workspace(mocker)
test_BaseController_next_calls_switch_workspace_not_first_time(mocker)
test_BaseController_next_calls_update_widgets(mocker)
test_BaseController_next_not_calling_remove_listed(mocker)
test_BaseController_next_not_calling_root_geometry_for_first_time_False(mocker)
test_BaseController_next_not_calling_save_on_StopIteration(mocker)
test_BaseController_next_not_calling_set_screenshot(mocker)
test_BaseController_next_not_calling_switch_workspace_first_time(mocker)
test_BaseController_next_not_calling_switch_workspace_from_workspace(mocker)
test_BaseController_next_not_calling_switch_workspace_same_workspace(mocker)
test_BaseController_next_returns_False(mocker)
test_BaseController_next_returns_True_on_StopIteration(mocker)
test_BaseController_next_runs_generator(mocker)
test_BaseController_next_sets_snapping_targets_attribute(mocker)
test_BaseController_next_sets_state_attr_to_positioning_corner_0(mocker)
test_BaseController_run_calls_activate_root_task(mocker)
test_BaseController_run_calls_display_message(mocker)
test_BaseController_run_calls_mainloop(mocker)
test_BaseController_run_calls_mouse_start(mocker)
test_BaseController_run_calls_next(mocker)
test_BaseController_run_calls_prepare_view(mocker)
test_BaseController_run_calls_view_startup(mocker)
test_BaseController_run_sets_generator_attr_from_provided_attr(mocker)
test_BaseController_update_calls_display_message_for_LOCATE(mocker)
test_BaseController_update_calls_display_message_for_RESIZE(mocker)
test_BaseController_update_calls_update_positioning_for_LOCATE(mocker)
test_BaseController_update_calls_update_resizing_for_RESIZE(mocker)
test_BaseController_update_not_calling_update_methods_for_other_states(mocker, state)
test_BaseController_update_positioning_calls_next_for_not_resizable(mocker)
test_BaseController_update_positioning_calls_run_task_move_w_not_resizable_ws(mocker)
test_BaseController_update_positioning_calls_run_task_move_window_not_resizable(mocker)
test_BaseController_update_positioning_calls_set_changed(mocker, state, sign_x, sign_y)
test_BaseController_update_positioning_for_resizable_calls_master_update(mocker)
test_BaseController_update_positioning_for_resizable_calls_place_on_opposite(mocker)
test_BaseController_update_positioning_for_resizable_calls_set_screenshot(mocker)
test_BaseController_update_positioning_for_resizable_not_calling_set_screenshot(mocker)
test_BaseController_update_positioning_for_resizable_sets_state(mocker)
test_BaseController_update_positioning_not_calling_run_task_move_w_not_resize(mocker)
test_BaseController_update_resizing_calls_next(mocker)
test_BaseController_update_resizing_calls_run_task_move_and_resize_for_ws(mocker)
test_BaseController_update_resizing_calls_run_task_move_and_resize_window(mocker)
test_BaseController_update_resizing_corner_0_calls_set_changed(mocker)
test_BaseController_update_resizing_corner_1_calls_set_changed(mocker)
test_BaseController_update_resizing_corner_2_calls_set_changed(mocker)
test_BaseController_update_resizing_corner_3_calls_set_changed(mocker)
test_BaseController_update_resizing_skips_run_task_move_and_resize_window(mocker)
test_BaseController_workspace_activated_calls_display_message(mocker)
test_BaseController_workspace_activated_calls_recapture_mouse_for_OTHER(mocker)
test_BaseController_workspace_activated_calls_set_changed(mocker)
test_BaseController_workspace_activated_calls_task_move_to_workspace(mocker)
test_BaseController_workspace_activated_not_calling_recapture_mouse_not_OTHER(mocker, state)
tests.unit.test_basecontroller – Unit tests for BaseController class (not including domain logic)
class tests.unit.test_basecontroller.TestBaseController

Bases: object

Testing class for base Controller class.

test_BaseController_change_position_calls_check_snapping(mocker)
test_BaseController_change_position_calls_get_root_rect(mocker)
test_BaseController_change_position_calls_master_geometry(mocker)
test_BaseController_change_position_not_calling_set_geometry_and_root_rect(mocker)
test_BaseController_change_setting_calls_run_task(mocker)
test_BaseController_change_size_calls_check_current_size(mocker)
test_BaseController_change_size_calls_check_snapping(mocker)
test_BaseController_change_size_calls_master_geometry(mocker)
test_BaseController_change_size_calls_set_minimum_size_and_returns_for_invalid(mocker)
test_BaseController_change_size_not_calling_set_geometry(mocker)
test_BaseController_change_size_valid_x_and_y(mocker, state, x, y, changed_x, changed_y, expected)
test_BaseController_change_size_with_min_valid_x_and_y(mocker, state, x, y, changed_x, changed_y, expected)
test_BaseController_check_current_size_for_invalid_xy_returns_position(mocker, corner, x, y, changed, expected)
test_BaseController_check_current_size_for_valid_xy_returns_False(mocker, corner, x, y, changed)
test_BaseController_check_mouse_calls_after_idle_with_mouse_move(mocker)
test_BaseController_check_mouse_calls_after_idle_with_mouse_scroll(mocker)
test_BaseController_check_mouse_calls_after_with_itself(mocker)
test_BaseController_check_mouse_calls_mouse_get_item(mocker)
test_BaseController_cycle_corners_calls_display_message(mocker)
test_BaseController_cycle_corners_calls_move_to_corner(mocker)
test_BaseController_cycle_corners_counter_false_functionality(mocker, state, expected)
test_BaseController_cycle_corners_counter_true_functionality(mocker, state, expected)
test_BaseController_cycle_corners_not_calling_move_to_corner(mocker)
test_BaseController_display_message_calls_set_timer_by_default(mocker)
test_BaseController_display_message_not_calling_set_timer_for_permanent(mocker)
test_BaseController_display_message_sets_statusbar_message(mocker)
test_BaseController_get_root_rect_functionality(mocker, state, expected)
test_BaseController_init_sets_app_attribute(mocker)
test_BaseController_initialization_calls_setup(mocker)
test_BaseController_initialization_instantiates_Mouse(mocker)
test_BaseController_initialization_instantiates_WindowModel(mocker)
test_BaseController_inits_attr_as_None(attr)
test_BaseController_inits_screenshot_when_exposed_as_False()
test_BaseController_listed_window_activated_by_digit_calls_l_window_activated(mocker)
test_BaseController_listed_window_activated_by_digit_calls_winfo_children(mocker)
test_BaseController_listed_window_activated_by_digit_not_calling_l_win_active(mocker)
test_BaseController_mainloop_calls_Tkinter_mainloop(mocker)
test_BaseController_mainloop_calls_after_for_check_mouse(mocker)
test_BaseController_mouse_move_calls_change_position_for_LOCATE(mocker)
test_BaseController_mouse_move_calls_change_size_for_RESIZE(mocker)
test_BaseController_mouse_scroll_calls_counter_false_cycle_corners(mocker)
test_BaseController_move_to_corner_calls_move_cursor_state_0(mocker)
test_BaseController_move_to_corner_calls_move_cursor_state_1(mocker)
test_BaseController_move_to_corner_calls_move_cursor_state_2(mocker)
test_BaseController_move_to_corner_calls_move_cursor_state_3(mocker)
test_BaseController_move_to_corner_calls_setup_corner(mocker)
test_BaseController_on_continue_calls_recapture_mouse(mocker)
test_BaseController_on_continue_returns_break(mocker)
test_BaseController_on_focus_calls_focus_get(mocker)
test_BaseController_on_focus_calls_run_task_activate_root(mocker)
test_BaseController_on_focus_not_calling_run_task(mocker)
test_BaseController_on_focus_not_returns_break(mocker)
test_BaseController_on_focus_returns_break(mocker)
test_BaseController_on_key_pressed_calls_cycle_corners(mocker, key)
test_BaseController_on_key_pressed_calls_release_mouse(mocker, key)
test_BaseController_on_key_pressed_calls_skip_current_window(mocker, key)
test_BaseController_on_key_pressed_calls_switch_resizable(mocker, key)
test_BaseController_on_key_pressed_calls_switch_restored(mocker, key)
test_BaseController_on_key_pressed_for_Enter_calls_update(mocker, key)
test_BaseController_on_key_pressed_for_Escape_calls_shutdown(mocker)
test_BaseController_on_key_pressed_for_digit_0_not_calling_workspace_activated_by_digit(mocker, key)
test_BaseController_on_key_pressed_for_digit_calls_workspace_activated_by_digit(mocker, key)
test_BaseController_on_key_pressed_for_func_keys_c_listed_window_activated_by_d(mocker, key)
test_BaseController_on_key_pressed_returns_break(mocker)
test_BaseController_on_mouse_left_down_calls_update(mocker)
test_BaseController_on_mouse_left_down_returns_break(mocker)
test_BaseController_on_mouse_middle_down_calls_release_mouse(mocker)
test_BaseController_on_mouse_middle_down_returns_break(mocker)
test_BaseController_on_mouse_right_down_calls_skip_current_window(mocker)
test_BaseController_on_mouse_right_down_returns_break(mocker)
test_BaseController_on_mouse_scroll_calls_counter_true_cycle_corners(mocker)
test_BaseController_on_resizable_calls_recapture_mouse(mocker)
test_BaseController_on_resizable_calls_switch_resizable(mocker)
test_BaseController_on_resizable_returns_break(mocker)
test_BaseController_on_restored_change_calls_recapture_mouse(mocker)
test_BaseController_on_restored_change_calls_switch_restored(mocker)
test_BaseController_on_restored_change_returns_break(mocker)
test_BaseController_place_on_opposite_corner_calls_min_move_cursor(mocker, state, x, y, w, h, expected_x, expected_y)
test_BaseController_place_on_opposite_corner_calls_move_cursor(mocker, state, x, y, w, h, expected_x, expected_y)
test_BaseController_place_on_opposite_corner_calls_setup_corner(mocker)
test_BaseController_place_on_top_left_calls_move_cursor(mocker)
test_BaseController_place_on_top_left_calls_setup_corner(mocker)
test_BaseController_prepare_view_calls_WindowsList_add_windows_without_first(mocker)
test_BaseController_prepare_view_calls_WorkspacesCollection_add_workspaces(mocker)
test_BaseController_recapture_mouse_calls_display_message(mocker)
test_BaseController_recapture_mouse_calls_mouse_start(mocker)
test_BaseController_recapture_mouse_calls_move_cursor(mocker)
test_BaseController_recapture_mouse_calls_set_default_geometry(mocker)
test_BaseController_recapture_mouse_calls_setup_corner(mocker)
test_BaseController_recapture_mouse_calls_view_setup_bindings(mocker)
test_BaseController_recapture_mouse_changes_state_to_LOCATE(mocker)
test_BaseController_release_mouse_calls_cursor_config(mocker)
test_BaseController_release_mouse_calls_display_message(mocker)
test_BaseController_release_mouse_calls_reset_bindings(mocker)
test_BaseController_release_mouse_calls_view_corner_hide_corner(mocker)
test_BaseController_release_mouse_changes_state_to_OTHER(mocker)
test_BaseController_release_mouse_stops_mouse_listener(mocker)
test_BaseController_remove_listed_window_calls_place_children(mocker)
test_BaseController_remove_listed_window_calls_widget_destroy(mocker)
test_BaseController_remove_listed_window_not_calling_destroy_for_wrong_widget(mocker)
test_BaseController_resizing_state_counterpart(mocker, state, expected)
test_BaseController_set_default_geometry_calls_geometry(mocker)
test_BaseController_set_default_geometry_calls_get_smallest_monitor_size(mocker)
test_BaseController_set_default_geometry_calls_quarter_by_smaller(mocker)
test_BaseController_set_default_geometry_not_calling_quarter_by_smaller(mocker)
test_BaseController_set_default_geometry_not_changing_default_size(mocker)
test_BaseController_set_default_geometry_sets_default_size(mocker)
test_BaseController_set_minimum_size_functionality(mocker)
test_BaseController_set_screenshot_calls_grab_window_screen(mocker)
test_BaseController_set_screenshot_calls_master_update(mocker)
test_BaseController_set_screenshot_calls_run_task(mocker)
test_BaseController_set_screenshot_configures_screenshot_widget(mocker)
test_BaseController_set_screenshot_places_screenshot_widget(mocker)
test_BaseController_set_screenshot_returns_True_for_disabled(mocker)
test_BaseController_set_screenshot_sets_screenshot_reference_variable(mocker)
test_BaseController_set_timer_calls_after(mocker)
test_BaseController_set_timer_calls_after_cancel(mocker)
test_BaseController_set_timer_not_calling_after_cancel(mocker)
test_BaseController_set_timer_sets_timer_attribute(mocker)
test_BaseController_setup_calls_get_screenshot_widget(mocker)
test_BaseController_setup_calls_get_tkinter_root(mocker)
test_BaseController_setup_calls_setup_root_window(mocker)
test_BaseController_setup_corner_calls_cursor_config(mocker, state)
test_BaseController_setup_corner_calls_get_cursor_name(mocker)
test_BaseController_setup_corner_calls_view_corner_set_corner(mocker)
test_BaseController_setup_initializes_ViewApplication(mocker)
test_BaseController_setup_root_window_calls_config_background(mocker)
test_BaseController_setup_root_window_calls_wm_attributes(mocker)
test_BaseController_setup_root_window_not_calling_alpha(mocker)
test_BaseController_shutdown_calls_master_destroy(mocker)
test_BaseController_shutdown_raises_SystemExit(mocker)
test_BaseController_shutdown_stops_mouse(mocker)
test_BaseController_skip_current_window_calls_display_message(mocker)
test_BaseController_skip_current_window_calls_model_clear_changed(mocker)
test_BaseController_skip_current_window_calls_next(mocker)
test_BaseController_switch_resizable_calls_display_message(mocker)
test_BaseController_switch_resizable_calls_widget_set_value(mocker)
test_BaseController_switch_resizable_functionality(mocker, resizable, expected)
test_BaseController_switch_restored_calls_display_message(mocker)
test_BaseController_switch_restored_calls_widget_set_value(mocker)
test_BaseController_switch_restored_functionality(mocker, restored, expected)
test_BaseController_switch_workspace_calls_display_message(mocker)
test_BaseController_switch_workspace_calls_get_root_wid(mocker)
test_BaseController_switch_workspace_calls_task_move_to_workspace(mocker)
test_BaseController_workspace_activated_by_digit_calls_winfo_children(mocker)
test_BaseController_workspace_activated_by_digit_calls_workspace_activated(mocker)
test_BaseController_workspace_activated_by_digit_not_calling_workspace_active(mocker)
tests.unit.test_data – Unit tests for window model and collection
class tests.unit.test_data.TestWindowModel

Bases: object

Testing class for arrangeit.data.WindowModel class.

test_WindowModel_changed_h_gets_h_from_changed()
test_WindowModel_changed_h_gets_h_from_rect()
test_WindowModel_changed_w_gets_w_from_changed()
test_WindowModel_changed_w_gets_w_from_rect()
test_WindowModel_changed_x_gets_x_from_changed()
test_WindowModel_changed_x_gets_x_from_rect()
test_WindowModel_changed_y_gets_y_from_changed()
test_WindowModel_changed_y_gets_y_from_rect()
test_WindowModel_clear_changed_sets_changed_to_empty_tuple(mocker)
test_WindowModel_clear_changed_sets_changed_ws_to_None(mocker)
test_WindowModel_h_gets_height_from_rect()
test_WindowModel_initialization_calls_setup(mocker)
test_WindowModel_inits_attr_as_None_or_empty_tuple(attr)
test_WindowModel_inits_changed_as_empty_tuple()
test_WindowModel_inits_changed_ws_as_None()
test_WindowModel_is_changed_functionality(changed, expected)
test_WindowModel_is_ws_changed_functionality(changed_ws, ws, expected)
test_WindowModel_set_changed_creates_empty_tuple_for_invalid(values)
test_WindowModel_set_changed_creates_empty_tuple_invalid_rect(values)
test_WindowModel_set_changed_creates_from_rect(values)
test_WindowModel_set_changed_creates_from_rect_elements_changed(values)
test_WindowModel_set_changed_creates_from_rect_elements_rect(values)
test_WindowModel_set_changed_not_changing_same_value(values)
test_WindowModel_set_changed_sets_changed_ws_and_changed(values)
test_WindowModel_set_changed_sets_changed_ws_for_provided_ws(ws)
test_WindowModel_set_changed_sets_changed_ws_to_None_for_invalid(ws)
test_WindowModel_setup_calls_get_value_if_valid_type_for_all(mocker, values)
test_WindowModel_setup_set_None_or_empty_for_invalid_type(mocker, values)
test_WindowModel_setup_sets_None_for_values_not_provided(mocker, values)
test_WindowModel_setup_sets_attrs_for_valid_type(mocker, values)
test_WindowModel_setup_sets_attrs_if_provided(mocker, values)
test_WindowModel_w_gets_width_from_rect()
test_WindowModel_ws_is_alias_for_workspace()
test_WindowModel_x_gets_x_from_rect()
test_WindowModel_y_gets_y_from_rect()
class tests.unit.test_data.TestWindowsCollection

Bases: object

Testing class for arrangeit.data.WindowsCollection class.

test_WindowsCollection_add_appends_one_element_to__members()
test_WindowsCollection_add_raises_for_invalid_argument(arg)
test_WindowsCollection_clear_empties__members()
test_WindowsCollection_export(elements)
test_WindowsCollection_generator_next_yields_value()
test_WindowsCollection_generator_type()
test_WindowsCollection_get_model_by_wid_empty_collection()
test_WindowsCollection_get_model_by_wid_invalid_wid()
test_WindowsCollection_get_model_by_wid_valid_wid()
test_WindowsCollection_get_windows_calls_generator(mocker)
test_WindowsCollection_get_windows_list_returns_list_of_windows()
test_WindowsCollection_initialization_sets_empty__members()
test_WindowsCollection_inits_____members_as_None()
test_WindowsCollection_repopulate_for_wid_functionality(elements, wid, remove_before, expected)
test_WindowsCollection_size_is_property()
test_WindowsCollection_size_returns__members_length()
test_WindowsCollection_sort_functionality(ws_wid, expected)
tests.unit.test_view – Unit tests for view classes and functions (without ViewApplication)
class tests.unit.test_view.TestCornerWidget

Bases: object

Unit testing class for CornerWidget class.

test_view_CornerWidget_anchor_functionality(mocker, corner, expected)
test_view_CornerWidget_get_place_parameters_functionality(mocker, corner, size, expected)
test_view_CornerWidget_hide_corner_hides_frames(mocker)
test_view_CornerWidget_init_calls_setup_widgets(mocker)
test_view_CornerWidget_init_sets_attributes(mocker, attr)
test_view_CornerWidget_inits_attributes(attr, value)
test_view_CornerWidget_issubclass_of_object()
test_view_CornerWidget_max_box_functionality(mocker, shift, expected)
test_view_CornerWidget_max_box_is_property()
test_view_CornerWidget_max_xy_functionality(mocker, shift, expected)
test_view_CornerWidget_max_xy_is_property()
test_view_CornerWidget_set_corner_calls_frame_place(mocker)
test_view_CornerWidget_set_corner_calls_get_place_parameters_with_max_box(mocker)
test_view_CornerWidget_set_corner_calls_get_place_parameters_with_max_xy(mocker)
test_view_CornerWidget_setup_widgets_calls_set_corner(mocker)
test_view_CornerWidget_setup_widgets_instantiates_frame_and_sets_attribute_for_it(mocker, attr, width, height)
class tests.unit.test_view.TestListedWindow

Bases: object

Unit testing class for ListedWindow class.

test_view_ListedWindow_get_icon_image_calls_ImageTk_PhotoImage(mocker)
test_view_ListedWindow_init_calls_get_icon_image(mocker)
test_view_ListedWindow_init_calls_setup_bindings(mocker)
test_view_ListedWindow_init_calls_setup_widgets(mocker)
test_view_ListedWindow_init_calls_super_with_master_and_cursor_arg(mocker)
test_view_ListedWindow_init_sets_attributes(mocker, attr)
test_view_ListedWindow_inits_attr_as_empty(attr, value)
test_view_ListedWindow_issubclass_of_Frame()
test_view_ListedWindow_on_widget_enter_returns_break(mocker)
test_view_ListedWindow_on_widget_enter_sets_foreground(mocker)
test_view_ListedWindow_on_widget_leave_returns_break(mocker)
test_view_ListedWindow_on_widget_leave_sets_foreground(mocker)
test_view_ListedWindow_setup_bindings_callbacks(mocker, event, method)
test_view_ListedWindow_setup_bindings_labels_master_callbacks(mocker, event, method)
test_view_ListedWindow_setup_widgets_calls_config_background(mocker)
test_view_ListedWindow_setup_widgets_calls_label_place(mocker)
test_view_ListedWindow_setup_widgets_sets_icon_label(mocker)
test_view_ListedWindow_setup_widgets_sets_title_label(mocker)
class tests.unit.test_view.TestPropertyIcon

Bases: object

Unit testing class for PropertyIcon class.

test_view_PropertyIcon_init_calls_setup_bindings(mocker)
test_view_PropertyIcon_init_calls_setup_widgets(mocker)
test_view_PropertyIcon_init_calls_super_with_master_arg(mocker)
test_view_PropertyIcon_init_sets_attributes(mocker, attr)
test_view_PropertyIcon_inits_attr_as_empty(attr, value)
test_view_PropertyIcon_issubclass_of_Label()
test_view_PropertyIcon_on_widget_enter_configures_image(mocker)
test_view_PropertyIcon_on_widget_enter_returns_break(mocker)
test_view_PropertyIcon_on_widget_leave_configures_image(mocker)
test_view_PropertyIcon_on_widget_leave_returns_break(mocker)
test_view_PropertyIcon_set_value_calls_config(mocker)
test_view_PropertyIcon_set_value_sets_value_attribute(mocker)
test_view_PropertyIcon_setup_bindings_callbacks(mocker, event, method)
test_view_PropertyIcon_setup_bindings_labels_master_callbacks(mocker, event, method)
test_view_PropertyIcon_setup_widgets_configs_label(mocker)
test_view_PropertyIcon_setup_widgets_sets_colorized_icon_image(mocker, value, path)
test_view_PropertyIcon_setup_widgets_sets_icon_image(mocker, value, path)
class tests.unit.test_view.TestResizable

Bases: object

Unit testing class for Resizable class.

test_view_Resizable_init_calls_super_with_master_and_background_args(mocker)
test_view_Resizable_inits_attr_as_empty(attr, value)
test_view_Resizable_inits_image_name(attr, value)
test_view_Resizable_issubclass_of_PropertyIcon()
class tests.unit.test_view.TestRestored

Bases: object

Unit testing class for Restored class.

test_view_Restored_init_calls_super_with_master_and_background_args(mocker)
test_view_Restored_inits_attr_as_empty(attr, value)
test_view_Restored_inits_image_name(attr, value)
test_view_Restored_issubclass_of_PropertyIcon()
class tests.unit.test_view.TestStatusbar

Bases: object

Unit testing class for Statusbar class.

test_view_Statusbar_init_calls_setup_widgets(mocker)
test_view_Statusbar_init_calls_super_with_master_arg(mocker)
test_view_Statusbar_init_configures_background(mocker)
test_view_Statusbar_init_sets_attributes(mocker, attr)
test_view_Statusbar_inits_attributes(attr, value)
test_view_Statusbar_issubclass_of_Frame()
test_view_Statusbar_setup_widgets_calls_label_pack(mocker)
test_view_Statusbar_setup_widgets_sets_message_label(mocker)
test_view_Statusbar_setup_widgets_sets_tk_variable(mocker)
class tests.unit.test_view.TestToolbar

Bases: object

Unit testing class for Toolbar class.

test_view_Toolbar_init_calls_setup_widgets(mocker)
test_view_Toolbar_init_calls_super_with_master_arg(mocker)
test_view_Toolbar_init_configures_background(mocker)
test_view_Toolbar_init_sets_attributes(mocker, attr)
test_view_Toolbar_inits_attributes(attr, value)
test_view_Toolbar_issubclass_of_Frame()
test_view_Toolbar_on_options_click_hides_root(mocker)
test_view_Toolbar_on_options_click_initializes_Options(mocker)
test_view_Toolbar_on_options_click_sets_topmost_false(mocker)
test_view_Toolbar_on_options_click_sets_topmost_true(mocker)
test_view_Toolbar_setup_widgets_calls_button_place(mocker)
test_view_Toolbar_setup_widgets_sets_options_button(mocker)
test_view_Toolbar_setup_widgets_sets_quit_button(mocker)
class tests.unit.test_view.TestViewFunctions

Bases: object

Unit testing class for view module inner functions.

test_view_get_screenshot_widget_calls_label_place(mocker)
test_view_get_screenshot_widget_initializes_Label(mocker)
test_view_get_screenshot_widget_returns_label_instance(mocker)
test_view_get_tkinter_root_calls_set_icon(mocker)
test_view_get_tkinter_root_initializes_Tk(mocker)
test_view_get_tkinter_root_returns_Tk_instance(mocker)
test_view_get_tkinter_root_sets_title(mocker)
test_view_get_tkinter_root_withdraw_root(mocker)
class tests.unit.test_view.TestWindowsList

Bases: object

Unit testing class for WindowsList class.

test_view_WindowsList_add_windows_calls_place_widget_on_position(mocker, args)
test_view_WindowsList_add_windows_initializes_ListedWindow(mocker)
test_view_WindowsList_clear_list_calls_widget_destroy(mocker)
test_view_WindowsList_clear_list_calls_winfo_children(mocker)
test_view_WindowsList_init_calls_super_with_master_arg(mocker)
test_view_WindowsList_init_configures_background(mocker)
test_view_WindowsList_init_sets_master_attribute(mocker)
test_view_WindowsList_inits_attr_as_None(attr)
test_view_WindowsList_issubclass_of_Frame()
test_view_WindowsList_on_window_label_button_down_calls_listed_window_activated(mocker)
test_view_WindowsList_on_window_label_button_returns_break(mocker)
test_view_WindowsList_place_children_calls_place_widget_on_position(mocker)
test_view_WindowsList_place_widget_on_position_calls_place_on_frame(mocker)
class tests.unit.test_view.TestWorkspace

Bases: object

Unit testing class for Workspace class.

test_view_Workspace_get_humanized_number(mocker, number)
test_view_Workspace_init_calls_setup_bindings(mocker)
test_view_Workspace_init_calls_setup_widgets(mocker)
test_view_Workspace_init_calls_super_with_master_arg(mocker)
test_view_Workspace_init_sets_attributes(mocker, attr)
test_view_Workspace_inits_attr_as_empty(attr, value)
test_view_Workspace_issubclass_of_Frame()
test_view_Workspace_on_widget_enter_not_setting_foreground_for_active(mocker)
test_view_Workspace_on_widget_enter_returns_break(mocker)
test_view_Workspace_on_widget_enter_sets_foreground(mocker)
test_view_Workspace_on_widget_leave_not_setting_foreground_for_active(mocker)
test_view_Workspace_on_widget_leave_returns_break(mocker)
test_view_Workspace_on_widget_leave_sets_foreground(mocker)
test_view_Workspace_setup_bindings_callbacks(mocker, event, method)
test_view_Workspace_setup_bindings_labels_master_callbacks(mocker, event, method)
test_view_Workspace_setup_widgets_calls_get_humanized_number(mocker)
test_view_Workspace_setup_widgets_calls_label_place(mocker)
test_view_Workspace_setup_widgets_sets_name_label(mocker)
test_view_Workspace_setup_widgets_sets_number_label(mocker)
class tests.unit.test_view.TestWorkspacesCollection

Bases: object

Unit testing class for WorkspacesCollection class.

test_view_WorkspacesCollection_add_workspaces_calls_place_on_frame(mocker, args)
test_view_WorkspacesCollection_add_workspaces_initializes_Workspace(mocker)
test_view_WorkspacesCollection_add_workspaces_not_calling_place(mocker)
test_view_WorkspacesCollection_init_calls_config_background(mocker)
test_view_WorkspacesCollection_init_calls_super_with_master_arg(mocker)
test_view_WorkspacesCollection_init_sets_master_attribute(mocker)
test_view_WorkspacesCollection_inits_attributes(attr, value)
test_view_WorkspacesCollection_issubclass_of_Frame()
test_view_WorkspacesCollection_on_workspace_label_button_down_calls_workspace_active(mocker)
test_view_WorkspacesCollection_on_workspace_label_button_returns_break(mocker)
test_view_WorkspacesCollection_select_active_calls_cursor_config(mocker)
test_view_WorkspacesCollection_select_active_calls_label_config(mocker)
test_view_WorkspacesCollection_select_active_for_single_workspace(mocker)
test_view_WorkspacesCollection_select_active_sets_active_attr(mocker)
tests.unit.test_viewapplication – Unit tests for ViewApplication class
class tests.unit.test_viewapplication.TestViewApplication

Bases: object

Unit testing class for ViewApplication class.

test_ViewApplication_get_root_wid_calls_int_and_returns_it(mocker)
test_ViewApplication_get_root_wid_calls_master_frame(mocker)
test_ViewApplication_hide_root_calls_master_hiding_up_method(mocker, method)
test_ViewApplication_init_calls_super_with_master_arg(mocker)
test_ViewApplication_init_configures_background(mocker)
test_ViewApplication_init_sets_master_and_controller_attributes(mocker)
test_ViewApplication_inits_calls_setup_bindings(mocker)
test_ViewApplication_inits_calls_setup_widgets(mocker)
test_ViewApplication_issubclass_of_Frame()
test_ViewApplication_reset_bindings_labels_bind_callback(mocker, event, method)
test_ViewApplication_reset_bindings_unbind_all(mocker, event)
test_ViewApplication_reset_bindings_windowslist_bind_callback(mocker, event, method)
test_ViewApplication_reset_bindings_workspaces_bind_callback(mocker, event, method)
test_ViewApplication_setup_bindings_bind_all_callbacks(mocker, event, method)
test_ViewApplication_setup_bindings_bind_callbacks(mocker, event, method)
test_ViewApplication_setup_bindings_label_bind_callbacks(mocker, event, method)
test_ViewApplication_setup_bindings_root_bind_callbacks(mocker, event, method)
test_ViewApplication_setup_bindings_unbinds_all_button_1(mocker)
test_ViewApplication_setup_corner_instantiates_CornerWidget(mocker)
test_ViewApplication_setup_corner_sets_corner_attribute(mocker)
test_ViewApplication_setup_icon_calls_label_place(mocker)
test_ViewApplication_setup_icon_sets_icon_label(mocker)
test_ViewApplication_setup_name_calls_label_place(mocker)
test_ViewApplication_setup_name_sets_name_label(mocker)
test_ViewApplication_setup_name_sets_tk_variable(mocker)
test_ViewApplication_setup_resizable_calls_label_place(mocker)
test_ViewApplication_setup_resizable_initializes_Resizable(mocker)
test_ViewApplication_setup_resizable_sets_viewapp_as_master(mocker)
test_ViewApplication_setup_restored_calls_label_place(mocker)
test_ViewApplication_setup_restored_initializes_Restored(mocker)
test_ViewApplication_setup_restored_sets_viewapp_as_master(mocker)
test_ViewApplication_setup_statusbar_calls_Statusbar_place(mocker)
test_ViewApplication_setup_statusbar_initializes_statusbar(mocker)
test_ViewApplication_setup_statusbar_sets_viewapp_as_master(mocker)
test_ViewApplication_setup_title_calls_label_place(mocker)
test_ViewApplication_setup_title_sets_title_label(mocker)
test_ViewApplication_setup_title_sets_tk_variable(mocker, name, typ)
test_ViewApplication_setup_toolbar_calls_Toolbar_place(mocker)
test_ViewApplication_setup_toolbar_initializes_Toolbar(mocker)
test_ViewApplication_setup_toolbar_sets_viewapp_as_master(mocker)
test_ViewApplication_setup_widgets_calls_setup_corner(mocker)
test_ViewApplication_setup_widgets_calls_setup_icon(mocker)
test_ViewApplication_setup_widgets_calls_setup_name(mocker)
test_ViewApplication_setup_widgets_calls_setup_resizable(mocker)
test_ViewApplication_setup_widgets_calls_setup_restored(mocker)
test_ViewApplication_setup_widgets_calls_setup_statusbar(mocker)
test_ViewApplication_setup_widgets_calls_setup_title(mocker)
test_ViewApplication_setup_widgets_calls_setup_toolbar(mocker)
test_ViewApplication_setup_widgets_calls_setup_windows(mocker)
test_ViewApplication_setup_widgets_calls_setup_workspaces(mocker)
test_ViewApplication_setup_windows_calls_WindowsList_place(mocker)
test_ViewApplication_setup_windows_initializes_WindowsList(mocker)
test_ViewApplication_setup_windows_sets_viewapp_as_master(mocker)
test_ViewApplication_setup_workspaces_calls_WorkspacesCollection_place(mocker)
test_ViewApplication_setup_workspaces_initializes_WorkspacesCollection(mocker)
test_ViewApplication_setup_workspaces_sets_viewapp_as_master(mocker)
test_ViewApplication_show_root_calls_master_showing_up_method(mocker, method)
test_ViewApplication_startup_calls_configure_on_labels(mocker)
test_ViewApplication_startup_calls_focus_set_on_view_frame(mocker)
test_ViewApplication_startup_calls_place_on_view_frame(mocker)
test_ViewApplication_startup_calls_show_root(mocker)
test_ViewApplication_update_widgets_calls_ImageTk_PhotoImage(mocker)
test_ViewApplication_update_widgets_calls_resizable_set_value(mocker)
test_ViewApplication_update_widgets_calls_restored_set_value(mocker)
test_ViewApplication_update_widgets_calls_workspaces_select_active(mocker)
test_ViewApplication_update_widgets_sets_attr(mocker, attr, val, typ)
test_ViewApplication_update_widgets_sets_icon(mocker)
test_ViewApplication_update_widgets_sets_icon_image(mocker)
tests.unit.test_options – Unit tests for options classes and functions
class tests.unit.test_options.TestAboutDialog

Bases: object

Unit testing class for AboutDialog class.

test_AboutDialog_init_calls_geometry_on_master_position(mocker)
test_AboutDialog_init_calls_setup_widgets(mocker)
test_AboutDialog_init_calls_super_with_master_arg(mocker)
test_AboutDialog_init_sets_about_dialog_title(mocker)
test_AboutDialog_init_sets_master_attribute(mocker)
test_AboutDialog_inits_attributes(attr, value)
test_AboutDialog_issubclass_of_Toplevel()
test_AboutDialog_on_help_click_opens_webbrowser(mocker)
test_AboutDialog_on_releases_click_opens_webbrowser(mocker)
test_AboutDialog_setup_widgets_calls_buttons_pack(mocker)
test_AboutDialog_setup_widgets_calls_get_resized_image(mocker)
test_AboutDialog_setup_widgets_calls_get_resource_path(mocker)
test_AboutDialog_setup_widgets_calls_logo_label_pack(mocker)
test_AboutDialog_setup_widgets_calls_notice_label_pack(mocker)
test_AboutDialog_setup_widgets_calls_open(mocker)
test_AboutDialog_setup_widgets_calls_separator_pack(mocker)
test_AboutDialog_setup_widgets_calls_version_pack(mocker)
test_AboutDialog_setup_widgets_sets_arrangeit_version_label(mocker)
test_AboutDialog_setup_widgets_sets_exit_button(mocker)
test_AboutDialog_setup_widgets_sets_gui_version_label(mocker)
test_AboutDialog_setup_widgets_sets_help_button(mocker)
test_AboutDialog_setup_widgets_sets_logo_label(mocker)
test_AboutDialog_setup_widgets_sets_notice_label(mocker)
test_AboutDialog_setup_widgets_sets_python_version_label(mocker)
test_AboutDialog_setup_widgets_sets_releases_button(mocker)
test_AboutDialog_setup_widgets_sets_separator(mocker)
test_AboutDialog_setup_widgets_sets_system_version_label(mocker)
test_AboutDialog_setup_widgets_sets_tcl_tk_version_label(mocker)
test_OptionsDialog_init_calls_set_icon(mocker)
class tests.unit.test_options.TestCheckOption

Bases: object

Unit testing class for CheckOption class.

test_CheckOption_init_calls_super_with_master_arg(mocker)
test_CheckOption_init_configs_attributes(mocker)
test_CheckOption_init_deselects_for_initial_value_False(mocker)
test_CheckOption_init_selects_for_initial_value_True(mocker)
test_CheckOption_init_sets_change_callback_attribute(mocker)
test_CheckOption_init_sets_master_attribute(mocker)
test_CheckOption_init_sets_name_attribute(mocker)
test_CheckOption_init_sets_var_attribute(mocker)
test_CheckOption_inits_attributes(attr, value)
test_CheckOption_issubclass_of_Checkbutton()
test_CheckOption_on_update_value_calls_master_change_setting(mocker)
test_CheckOption_on_update_value_returns_break(mocker)
class tests.unit.test_options.TestColorOption

Bases: object

Unit testing class for ColorOption class.

test_CheckOption_init_instantiates_and_sets_label_attribute(mocker)
test_CheckOption_init_sets_change_callback_attribute(mocker)
test_ColorOption_init_calls_StringVar_set(mocker)
test_ColorOption_init_calls_super_with_provided_arguments(mocker)
test_ColorOption_init_sets_COLORS_as_initial_choices(mocker)
test_ColorOption_init_sets_master_attribute(mocker)
test_ColorOption_init_sets_name_attribute(mocker)
test_ColorOption_init_sets_var_attribute(mocker)
test_ColorOption_inits_attributes(attr, value)
test_ColorOption_issubclass_of_OptionMenu()
test_ColorOption_on_update_value_calls_change_setting(mocker)
test_ColorOption_on_update_value_returns_break(mocker)
class tests.unit.test_options.TestFloatScaleOption

Bases: object

Unit testing class for FloatScaleOption class.

test_FloatScaleOption_init_multiplies_initial_by_100(mocker)
test_FloatScaleOption_issubclass_of_ScaleOption()
test_FloatScaleOption_on_update_value_calls_master_change_setting(mocker)
test_FloatScaleOption_on_update_value_returns_break(mocker)
class tests.unit.test_options.TestOptionsDialog

Bases: object

Unit testing class for OptionsDialog class.

test_OptionsDialog_change_setting_calls_controller_change_setting(mocker)
test_OptionsDialog_change_setting_calls_set_timer(mocker)
test_OptionsDialog_change_setting_changes_message_var(mocker)
test_OptionsDialog_change_setting_for_float_calls_controller_change_setting(mocker)
test_OptionsDialog_change_setting_not_called_upon_startup(mocker)
test_OptionsDialog_create_frame_instantiates_ttk_Frame(mocker)
test_OptionsDialog_create_frame_returns_frame(mocker)
test_OptionsDialog_create_separator_instantiates_ttk_Separator(mocker)
test_OptionsDialog_create_separator_instantiates_vertical_ttk_Separator(mocker)
test_OptionsDialog_create_widget_calls_widget_class_from_name(mocker)
test_OptionsDialog_create_widget_instantiates_float_scale_widget(mocker)
test_OptionsDialog_create_widget_instantiates_widget(mocker)
test_OptionsDialog_create_widget_instantiates_widget_with_kwargs(mocker)
test_OptionsDialog_init_calls_geometry_on_root_position(mocker)
test_OptionsDialog_init_calls_set_icon(mocker)
test_OptionsDialog_init_calls_setup_bindings(mocker)
test_OptionsDialog_init_calls_setup_widgets(mocker)
test_OptionsDialog_init_calls_super_with_master_arg(mocker)
test_OptionsDialog_init_sets_master_attribute(mocker)
test_OptionsDialog_init_sets_options_dialog_title(mocker)
test_OptionsDialog_inits_attributes(attr, value)
test_OptionsDialog_issubclass_of_Toplevel()
test_OptionsDialog_on_destroy_options_destroys_options(mocker)
test_OptionsDialog_on_destroy_options_shows_root(mocker)
test_OptionsDialog_on_save_default_calls_controller_save(mocker)
test_OptionsDialog_on_save_default_calls_set_timer(mocker)
test_OptionsDialog_on_save_default_changes_message_var(mocker)
test_OptionsDialog_on_show_about_calls_lift(mocker)
test_OptionsDialog_on_show_about_instantiates_AboutDialog(mocker)
test_OptionsDialog_set_timer_calls_after(mocker)
test_OptionsDialog_set_timer_calls_after_cancel_if_timer_exists(mocker)
test_OptionsDialog_set_timer_sets_timer_attribute(mocker)
test_OptionsDialog_setup_bindings_binds_callback(mocker, event, callback)
test_OptionsDialog_setup_files_section_calls_button_pack(mocker)
test_OptionsDialog_setup_files_section_inits_LabelFrame(mocker)
test_OptionsDialog_setup_files_section_returns_LabelFrame(mocker)
test_OptionsDialog_setup_files_section_sets_save_default_button(mocker)
test_OptionsDialog_setup_section_calls_Frame_pack(mocker)
test_OptionsDialog_setup_section_calls_Separator_pack(mocker)
test_OptionsDialog_setup_section_calls_create_frame(mocker)
test_OptionsDialog_setup_section_calls_create_separator(mocker)
test_OptionsDialog_setup_section_calls_create_widget(mocker)
test_OptionsDialog_setup_section_calls_widget_label_pack(mocker)
test_OptionsDialog_setup_section_calls_widget_pack(mocker)
test_OptionsDialog_setup_section_inits_LabelFrame(mocker)
test_OptionsDialog_setup_section_returns_section(mocker)
test_OptionsDialog_setup_widgets_calls_LabelFrame_pack(mocker)
test_OptionsDialog_setup_widgets_calls_about_button_pack(mocker)
test_OptionsDialog_setup_widgets_calls_label_pack(mocker)
test_OptionsDialog_setup_widgets_calls_quit_button_pack(mocker)
test_OptionsDialog_setup_widgets_calls_setup_files_section(mocker)
test_OptionsDialog_setup_widgets_calls_setup_section_for_appearance(mocker)
test_OptionsDialog_setup_widgets_calls_setup_section_for_colors(mocker)
test_OptionsDialog_setup_widgets_sets_about_button(mocker)
test_OptionsDialog_setup_widgets_sets_label_for_message(mocker)
test_OptionsDialog_setup_widgets_sets_message_var(mocker)
test_OptionsDialog_setup_widgets_sets_quit_button(mocker)
test_OptionsDialog_widget_class_from_name_calls_setting_type(mocker)
test_OptionsDialog_widget_class_from_name_for_typ_None(mocker)
class tests.unit.test_options.TestOptionsModule

Bases: object

Unit testing class for options module and OptionsMetaclass

test_options_module_CLASSES()
test_options_module_COLORS_is_dictionary()
test_options_module_MESSAGES_is_dictionary()
test_options_module_WIDGETS_has_valid_format_for_all()
test_options_module_WIDGETS_is_dictionary()
class tests.unit.test_options.TestScaleOption

Bases: object

Unit testing class for ScaleOption class.

test_ScaleOption_init_calls_super_with_master_arg(mocker)
test_ScaleOption_init_configs_attributes(mocker)
test_ScaleOption_init_configs_command(mocker)
test_ScaleOption_init_sets_change_callback_attribute(mocker)
test_ScaleOption_init_sets_initial(mocker)
test_ScaleOption_init_sets_master_attribute(mocker)
test_ScaleOption_init_sets_name_attribute(mocker)
test_ScaleOption_inits_attributes(attr, value)
test_ScaleOption_issubclass_of_Scale()
test_ScaleOption_on_update_value_calls_master_change_setting(mocker)
test_ScaleOption_on_update_value_returns_break(mocker)
class tests.unit.test_options.TestThemeOption

Bases: object

Unit testing class for ThemeOption class.

test_ThemeOption_init_sets_initial_BG_from_Settings(mocker)
test_ThemeOption_init_sets_initial_FG_from_Settings(mocker)
test_ThemeOption_issubclass_of_ColorOption()
tests.unit.test_utils – Unit tests for helper functions
class tests.unit.test_utils.TestUtils

Bases: object

Testing class for arrangeit.utils module.

test_utils_Rectangle_is_namedtuple_class()
test_utils__get_snapping_source_by_ordinal_ordinal(rect, expected)
test_utils__get_snapping_source_by_ordinal_returns_Rectangle()
test_utils_check_intersections_calls_intersects_twice_and_returns_two_tuple(mocker)
test_utils_check_intersections_single_calls_intersects_and_returns_False(mocker)
test_utils_check_intersections_single_functionality_for_full_sources(sources, targets, expected)
test_utils_check_intersections_single_functionality_for_two_sources_corner_0(sources, targets, expected)
test_utils_check_intersections_single_functionality_for_two_sources_corner_1(sources, targets, expected)
test_utils_check_intersections_single_functionality_for_two_sources_corner_2(sources, targets, expected)
test_utils_check_intersections_single_functionality_for_two_sources_corner_3(sources, targets, expected)
test_utils_get_class_involves_default_val_for_no_arg(mocker, name)
test_utils_get_component_class_calls_get_class(mocker, function)
test_utils_get_component_class_involves_provided_argument(mocker, name)
test_utils_get_component_class_raises_SystemExit_for_invalid_platform(platform, name)
test_utils_get_cursor_name_functionality(corner, with_arrow, expected)
test_utils_get_prepared_screenshot_calls_filter(mocker)
test_utils_get_prepared_screenshot_calls_filter_with_blur_size(mocker)
test_utils_get_prepared_screenshot_converts_to_grayscale_if_set(mocker)
test_utils_get_prepared_screenshot_not_converting_to_grayscale(mocker)
test_utils_get_prepared_screenshot_returns_ImageTk_PhotoImage(mocker)
test_utils_get_resized_image_calls_Image_open(mocker)
test_utils_get_resized_image_calls_Image_resize(mocker)
test_utils_get_resized_image_calls_and_retuurns_PhotoImage(mocker)
test_utils_get_resized_image_calls_get_resource_path(mocker)
test_utils_get_resource_path_calls_os_path_dirname(mocker)
test_utils_get_resource_path_calls_os_path_join(mocker)
test_utils_get_resource_path_returns_os_path_value()
test_utils_get_snapping_sources_for_rect_corner_0(rect, expected)
test_utils_get_snapping_sources_for_rect_corner_1(rect, expected)
test_utils_get_snapping_sources_for_rect_corner_2(rect, expected)
test_utils_get_snapping_sources_for_rect_corner_3(rect, expected)
test_utils_get_snapping_sources_for_rect_corner_None(rect, expected)
test_utils_get_value_if_valid_type_for_collection_returns_empty(value, typ)
test_utils_get_value_if_valid_type_for_collection_type_returns_value(value, typ)
test_utils_get_value_if_valid_type_for_single_type_returns_None(value, typ)
test_utils_get_value_if_valid_type_for_single_type_returns_value(value, typ)
test_utils_get_value_if_valid_type_returns_None_for_None_value(value, typ)
test_utils_increased_by_fraction(value, fraction, expected)
test_utils_intersects_functionality(source, target, expected)
test_utils_offset_for_intersecting_pair_corner_0_functionality(pair, offset)
test_utils_offset_for_intersecting_pair_corner_1_functionality(pair, offset)
test_utils_offset_for_intersecting_pair_corner_2_functionality(pair, offset)
test_utils_offset_for_intersecting_pair_corner_3_functionality(pair, offset)
test_utils_offset_for_intersecting_pair_returns_False(mocker)
test_utils_offset_for_intersections_calls__offset_once_for_single_pair(mocker)
test_utils_offset_for_intersections_calls__offset_twice_for_two_pairs(mocker)
test_utils_offset_for_intersections_returns_empty_tuple_for_no_rectangles(mocker)
test_utils_offset_for_intersections_returns_opposite_tuple_element(mocker)
test_utils_open_image_calls_ImageOps_colorize(mocker)
test_utils_open_image_calls_Image_convert(mocker)
test_utils_open_image_calls_Image_open(mocker)
test_utils_open_image_calls_different_ImageOps_colorize_if_colorized_set(mocker)
test_utils_open_image_calls_get_resource_path(mocker)
test_utils_open_image_returns_Image(mocker)
test_utils_platform_path_returns_lowercased_system_name(mocker, name)
test_utils_platform_user_data_path_calls_import_module(mocker)
test_utils_platform_user_data_path_calls_user_data_path(mocker)
test_utils_quarter_by_smaller(w, h, size, expected)
test_utils_quarter_by_smaller_out_of_range(size)
test_utils_set_icon_calls_PhotoImage(mocker)
test_utils_set_icon_calls_get_resource_path(mocker)
test_utils_set_icon_calls_tk_call(mocker)
tests.unit.test_settings – Unit tests for programs settings
class tests.unit.test_settings.TestSettings

Bases: object

Unit testing class for Settings.

test_Settings_availability_for_all_constants_in_SETTINGS()
test_Settings_color_group_returns_empty_list_for_no_group(mocker)
test_Settings_color_group_returns_list(mocker)
test_Settings_color_group_returns_type_for_valid_setting_name(mocker, group, expected)
test_Settings_initializes_blank_icon()
test_Settings_initializes_unchangeable_core_program_constant(constant, value)
test_Settings_is_setting_returns_False_for_core_setting(mocker)
test_Settings_is_setting_returns_False_for_invalid_setting(mocker)
test_Settings_is_setting_returns_False_for_invalid_value_type(mocker)
test_Settings_is_setting_returns_False_for_value_None(mocker)
test_Settings_is_setting_returns_True_for_valid_setting(mocker)
test_Settings_metaclass_is_SettingsMetaclass()
test_Settings_setting_type_returns_None_for_invalid(mocker)
test_Settings_setting_type_returns_type_for_valid(mocker)
test_Settings_setting_type_returns_type_for_valid_setting_name(mocker, name, typ)
class tests.unit.test_settings.TestSettingsModule

Bases: object

Unit testing class for settings module and SettingsMetaclass

test_SettingsMetaclass___getattr___calls_validate_user_settings_just_once(mocker)
test_SettingsMetaclass___getattr___not_changing_core_constant(constant)
test_SettingsMetaclass___getattr___returns_None_for_invalid_name()
test_SettingsMetaclass___getattr___uses_SETTINGS_for_no_user_setting()
test_SettingsMetaclass___getattr___uses_user_settings()
test_SettingsMetaclass_defines___getattr__()
test_SettingsMetaclass_is_metaclass()
test_settings_module_SETTINGS_for_value_type()
test_settings_module_SETTINGS_has_valid_format_for_all()
test_settings_module_SETTINGS_is_dictionary()
test_settings_module_initializes_MESSAGES()
test_settings_module_initializes_MESSAGES_key(key)
test_settings_module_initializes_SETTINGS()
test_settings_read_user_settings_calls_json_load(mocker)
test_settings_read_user_settings_calls_platform_user_data_path(mocker)
test_settings_read_user_settings_checks_if_directory_exists(mocker)
test_settings_read_user_settings_returns_dictionary()
test_settings_read_user_settings_returns_empty_for_exception(mocker)
test_settings_read_user_settings_returns_empty_if_not_exists(mocker)
test_settings_read_user_settings_returns_read_data_dictionary(mocker)
test_settings_validate_user_settings_returns_dictionary()
test_settings_validate_user_settings_returns_from_read_user(mocker)
test_settings_validate_user_settings_returns_only_valid_names_from_read_user(mocker)
test_settings_validate_user_settings_returns_only_valid_types_from_read_user(mocker)
tests.unit.test_darwin – Unit tests for Mac OS specific code
class tests.unit.test_darwin.TestDarwinApp

Bases: object

Testing class for arrangeit.darwin.app.App class.

test_DarwinApp_activate_root_returns(mocker)
test_DarwinApp_grab_window_screen_returns(mocker)
test_DarwinApp_move_and_resize_returns(mocker)
test_DarwinApp_move_calls_and_returns_move_and_resize(mocker)
test_DarwinApp_move_to_workspace_returns(mocker)
class tests.unit.test_darwin.TestDarwinCollector

Bases: object

Testing class for arrangeit.darwin.collector.Collector class.

test_DarwinCollector__get_application_icon_calls_Image_open(mocker)
test_DarwinCollector__get_application_icon_calls__running_apps_ids(mocker)
test_DarwinCollector__get_application_icon_calls_io_BytesIO(mocker)
test_DarwinCollector__get_application_icon_returns_Image(mocker)
test_DarwinCollector__get_window_geometry_calls_valueForKey_element(mocker, element)
test_DarwinCollector__get_window_geometry_calls_valueForKey_for_bounds(mocker)
test_DarwinCollector__get_window_geometry_returns_tuple_of_ints(mocker, element)
test_DarwinCollector__get_window_id_calls_valueForKey_(mocker)
test_DarwinCollector__get_window_title_calls_valueForKey_(mocker)
test_DarwinCollector__running_apps_ids_calls_runningApplications(mocker)
test_DarwinCollector__running_apps_ids_calls_sharedWorkspace(mocker)
test_DarwinCollector__running_apps_ids_functionality(mocker)
test_DarwinCollector_add_window_calls_WindowsCollection_add(mocker)
test_DarwinCollector_add_window_calls_methods(mocker, method)
test_DarwinCollector_add_window_inits_WindowModel(mocker)
test_DarwinCollector_check_window_calls(mocker, method)
test_DarwinCollector_check_window_returns_False_for_not_applicable(mocker)
test_DarwinCollector_check_window_returns_False_for_not_valid_state(mocker)
test_DarwinCollector_check_window_returns_True(mocker)
test_DarwinCollector_get_application_name_calls_valueForKey_(mocker)
test_DarwinCollector_get_available_workspaces_returns(mocker)
test_DarwinCollector_get_monitors_rects_calls_NSScreen_screens(mocker)
test_DarwinCollector_get_monitors_rects_returns_list_of_rect_parts(mocker)
test_DarwinCollector_get_windows_calls_CGWindowListCopyWindowInfo(mocker)
test_DarwinCollector_get_windows_returns_list(mocker)
test_DarwinCollector_get_workspace_number_for_window_returns(mocker)
test_DarwinCollector_is_applicable_calls__running_apps_ids(mocker)
test_DarwinCollector_is_applicable_functionality_for_empty_name(mocker)
test_DarwinCollector_is_applicable_functionality_for_name_None(mocker)
test_DarwinCollector_is_applicable_functionality_for_non_empty_name(mocker)
test_DarwinCollector_is_applicable_functionality_for_not_owner(mocker)
test_DarwinCollector_is_applicable_functionality_for_owner(mocker)
test_DarwinCollector_is_resizable_returns(mocker)
test_DarwinCollector_is_restored_returns(mocker)
test_DarwinCollector_is_valid_state_returns(mocker)
class tests.unit.test_darwin.TestDarwinUtils

Bases: object

Testing class for arrangeit.darwin.utils module.

test_darwin_utils_user_data_path_calls_NSSearchPathForDirectoriesInDomains(mocker)
test_darwin_utils_user_data_path_calls_os_path_join(mocker)
tests.unit.test_linux – Unit tests for GNU/Linux specific code
class tests.unit.test_linux.TestLinuxApp

Bases: object

Testing class for arrangeit.linux.app.App class.

test_LinuxApp__activate_workspace_calls_get_wnck_workspace_for_custom_number(mocker)
test_LinuxApp__activate_workspace_calls_workspace_activate(mocker)
test_LinuxApp__move_window_to_workspace_calls_Wnck_shutdown(mocker)
test_LinuxApp__move_window_to_workspace_calls__activate_workspace(mocker)
test_LinuxApp__move_window_to_workspace_calls_get_window_by_wid(mocker)
test_LinuxApp__move_window_to_workspace_calls_win_activate(mocker)
test_LinuxApp__move_window_to_workspace_calls_win_move_to_workspace(mocker)
test_LinuxApp__move_window_to_workspace_returns_False(mocker)
test_LinuxApp__move_window_to_workspace_returns_True(mocker)
test_LinuxApp__window_from_wid_calls_get_default(mocker)
test_LinuxApp__window_from_wid_calls_get_window_stack(mocker)
test_LinuxApp__window_from_wid_calls_get_xid(mocker)
test_LinuxApp__window_from_wid_returns_None(mocker)
test_LinuxApp__window_from_wid_returns_window_instance(mocker)
test_LinuxApp_activate_root_calls__window_from_wid(mocker)
test_LinuxApp_activate_root_calls_window_focus(mocker)
test_LinuxApp_grab_window_screen_calls__window_from_wid(mocker)
test_LinuxApp_grab_window_screen_calls_get_prepared_screenshot(mocker)
test_LinuxApp_grab_window_screen_calls_pixbuf_get_from_window(mocker)
test_LinuxApp_grab_window_screen_for_no_window_returns_empty_icon(mocker)
test_LinuxApp_grab_window_screen_returns_get_prepared_screenshot_image(mocker)
test_LinuxApp_move_and_resize_calls_WnckWindow_set_geometry(mocker)
test_LinuxApp_move_and_resize_calls__move_window_to_workspace(mocker)
test_LinuxApp_move_and_resize_calls_get_model_by_wid(mocker)
test_LinuxApp_move_and_resize_calls_get_window_by_wid(mocker)
test_LinuxApp_move_and_resize_calls_get_window_move_resize_mask(mocker)
test_LinuxApp_move_and_resize_calls_is_minimized(mocker)
test_LinuxApp_move_and_resize_calls_minimize(mocker)
test_LinuxApp_move_and_resize_calls_unmaximize(mocker)
test_LinuxApp_move_and_resize_calls_unminimize(mocker)
test_LinuxApp_move_and_resize_checks_maximized(mocker)
test_LinuxApp_move_and_resize_not_calling_WnckWindow_set_geometry(mocker)
test_LinuxApp_move_and_resize_not_calling__move_window_to_workspace(mocker)
test_LinuxApp_move_and_resize_not_calling_get_window_by_wid(mocker)
test_LinuxApp_move_and_resize_not_calling_minimize_not_minimized(mocker)
test_LinuxApp_move_and_resize_not_calling_minimize_not_restored(mocker)
test_LinuxApp_move_and_resize_not_calling_unmaximize(mocker)
test_LinuxApp_move_and_resize_not_calling_unminimize_not_minimized(mocker)
test_LinuxApp_move_and_resize_not_calling_unminimize_not_restored(mocker)
test_LinuxApp_move_and_resize_returns_False(mocker)
test_LinuxApp_move_and_resize_returns_True(mocker)
test_LinuxApp_move_calls_move_and_resize(mocker)
test_LinuxApp_move_to_workspace_calls__move_window_to_workspace(mocker)
class tests.unit.test_linux.TestLinuxCollector

Bases: object

Testing class for arrangeit.linux.collector.Collector class.

test_LinuxCollector__check_mask_part_functionality(mocker, rect, changed, expected)
test_LinuxCollector__get_available_wnck_workspaces_calls_Screen_methods(mocker, method)
test_LinuxCollector__get_available_wnck_workspaces_returns_list(mocker)
test_LinuxCollector_add_window_calls_WindowsCollection_add(mocker)
test_LinuxCollector_add_window_calls_Wnck_Window_methods(mocker, method)
test_LinuxCollector_add_window_calls_get_image_from_pixbuf(mocker)
test_LinuxCollector_add_window_calls_get_workspace_number_for_window(mocker)
test_LinuxCollector_add_window_calls_is_resizable(mocker)
test_LinuxCollector_add_window_calls_is_restored(mocker)
test_LinuxCollector_add_window_inits_WindowModel(mocker)
test_LinuxCollector_check_window_calls_W_get_state(mocker)
test_LinuxCollector_check_window_calls_W_get_window_type(mocker)
test_LinuxCollector_check_window_calls_is_applicable(mocker)
test_LinuxCollector_check_window_calls_is_valid_state(mocker)
test_LinuxCollector_check_window_returns_False_for_invalid_state(mocker)
test_LinuxCollector_check_window_returns_False_for_not_is_app(mocker)
test_LinuxCollector_check_window_returns_True_for_both_True(mocker)
test_LinuxCollector_get_available_workspaces_calls_W_workspace_get_name(mocker)
test_LinuxCollector_get_available_workspaces_calls__get_available_wnck(mocker)
test_LinuxCollector_get_available_workspaces_calls_get_workspace_number(mocker)
test_LinuxCollector_get_available_workspaces_functionality(mocker)
test_LinuxCollector_get_available_workspaces_returns_list(mocker)
test_LinuxCollector_get_available_workspaces_returns_one_element(mocker)
test_LinuxCollector_get_image_from_pixbuf_returns_valid_type()
test_LinuxCollector_get_monitors_rects_calls_GDK_display_get_default(mocker)
test_LinuxCollector_get_monitors_rects_calls_GDK_display_get_monitor(mocker)
test_LinuxCollector_get_monitors_rects_calls_GDK_display_get_n_monitors(mocker)
test_LinuxCollector_get_monitors_rects_calls_GDK_monitor_get_workarea(mocker)
test_LinuxCollector_get_monitors_rects_returns_list_of_rects(mocker)
test_LinuxCollector_get_window_by_wid_calls_Wnck_Window_get(mocker)
test_LinuxCollector_get_window_move_resize_mask_calls__check_mask_part(mocker)
test_LinuxCollector_get_windows_calls_Screen_methods(mocker, method)
test_LinuxCollector_get_wnck_workspace_for_custom_number_calls__get_available(mocker)
test_LinuxCollector_get_wnck_workspace_for_custom_number_calls_get_w_number(mocker)
test_LinuxCollector_get_workspace_number_for_window_calls_W_get_workspace(mocker)
test_LinuxCollector_get_workspace_number_for_window_calls_wn_for_window(mocker)
test_LinuxCollector_get_workspace_number_returns_0(mocker)
test_LinuxCollector_get_workspace_number_returns_correct_number(mocker, screen, workspace, expected)
test_LinuxCollector_is_applicable(window_type, value)
test_LinuxCollector_is_resizable(window_type, value)
test_LinuxCollector_is_restored(mocker)
test_LinuxCollector_is_valid_state(window_type, window_state, value)
test_LinuxCollector_rect_is_converted_to_tuple(mocker)
test_LinuxCollector_run_functionality(mocker, is_applicable, is_valid_state, value)
test_LinuxCollector_run_super(mocker)
class tests.unit.test_linux.TestLinuxController

Bases: object

Testing class for arrangeit.linux.controller.Controller class.

test_LinuxController_setup_root_window_calls_type_splash(mocker)
class tests.unit.test_linux.TestLinuxUtils

Bases: object

Testing class for arrangeit.linux.utils module.

test_linux_utils_module__user_data_path_for_local_share_not_exists(mocker)
test_linux_utils_module_user_data_path_checks_local_share_first(mocker)
tests.unit.test_windows – Unit tests for MS Windows specific code
class tests.unit.test_windows.TestWindowsApp

Bases: object

Testing class for arrangeit.windowe.app.App class.

test_WindowsApp__screenshot_with_thumbnails_calls_Rectangle_lower(mocker)
test_WindowsApp__screenshot_with_thumbnails_calls_Rectangle_right(mocker)
test_WindowsApp__screenshot_with_thumbnails_calls_setup_thumbnail_lower(mocker)
test_WindowsApp__screenshot_with_thumbnails_calls_setup_thumbnail_right(mocker)
test_WindowsApp__screenshot_with_thumbnails_returns__window_area_desktop_sc(mocker)
test_WindowsApp__screenshot_with_thumbnails_returns_blank_lower(mocker)
test_WindowsApp__screenshot_with_thumbnails_returns_blank_right(mocker)
test_WindowsApp__screenshot_with_thumbnails_sets_thumbnails_attribute(mocker)
test_WindowsApp__window_area_desktop_screenshot_calls_and_returns_grab(mocker)
test_WindowsApp__window_area_desktop_screenshot_calls_extended_frame_rect(mocker)
test_WindowsApp_activate_root_calls_SetActiveWindow(mocker)
test_WindowsApp_grab_window_screen_calls__screenshot_with_thumbnails(mocker)
test_WindowsApp_grab_window_screen_calls_get_prepared_screenshot(mocker)
test_WindowsApp_grab_window_screen_calls_is_dwm_composition_enabled(mocker)
test_WindowsApp_grab_window_screen_returns_blank(mocker)
test_WindowsApp_inits_thumbnails_as_empty_tuple()
test_WindowsApp_move_and_resize_calls_IsIconic(mocker)
test_WindowsApp_move_and_resize_calls_MoveWindow(mocker)
test_WindowsApp_move_and_resize_calls_ShowWindow_if_iconic(mocker)
test_WindowsApp_move_and_resize_calls_ShowWindow_minimized(mocker)
test_WindowsApp_move_and_resize_calls_get_model_by_wid(mocker)
test_WindowsApp_move_and_resize_calls_move_other_to_workspace(mocker)
test_WindowsApp_move_and_resize_not_calling_MoveWindow(mocker)
test_WindowsApp_move_and_resize_not_calling_ShowWindow_if_not_iconic(mocker)
test_WindowsApp_move_and_resize_not_calling_ShowWindow_minimized(mocker)
test_WindowsApp_move_and_resize_not_calling_move_other_to_workspace(mocker)
test_WindowsApp_move_and_resize_returns_False(mocker)
test_WindowsApp_move_and_resize_returns_True(mocker)
test_WindowsApp_move_calls_move_and_resize(mocker)
test_WindowsApp_move_other_to_workspace_calls_api_move_other_window_to_desktop(mocker)
test_WindowsApp_move_to_workspace_calls_and_returns_api_move_own_window_to_desktop(mocker)
test_WindowsApp_screenshot_cleanup_calls_unregister_thumbnail(mocker)
test_WindowsApp_screenshot_cleanup_not_calling_unregister_thumbnail_for_empty(mocker)
test_WindowsApp_screenshot_cleanup_sets_thumbnails_attribute_to_empty_tuple(mocker)
class tests.unit.test_windows.TestWindowsCollector

Bases: object

Testing class for arrangeit.windows.collector.Collector class.

test_WindowsCollector__get_application_icon_calls_GetClassLong(mocker)
test_WindowsCollector__get_application_icon_calls_SendMessageTimeout(mocker)
test_WindowsCollector__get_application_icon_calls__get_image_from_icon_handle(mocker)
test_WindowsCollector__get_application_icon_calls__get_uwpapp_icon(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_CreateBitmap(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_CreateDCFromHandle(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_GetDC(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_Image_frombuffer(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_bitmap_CreateCompatibleBitmap(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_bitmap_GetBitmapBits(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_dc_CreateCompatibleDC(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_dc_DrawIcon(mocker)
test_WindowsCollector__get_image_from_icon_handle_calls_dc_SelectObject(mocker)
test_WindowsCollector__get_uwpapp_icon_calls_get_package(mocker)
test_WindowsCollector__get_uwpapp_icon_returns_icon(mocker)
test_WindowsCollector__get_uwpapp_icon_sets_api_packages_for_hwnd(mocker)
test_WindowsCollector__get_window_geometry_calls_GetWindowPlacement(mocker)
test_WindowsCollector__get_window_geometry_calls_Rectangle(mocker)
test_WindowsCollector__get_window_geometry_calls_extended_frame_rect(mocker)
test_WindowsCollector__get_window_geometry_calls_is_dwm_composition_enabled(mocker)
test_WindowsCollector__get_window_geometry_returns_tuple_rect(mocker)
test_WindowsCollector__get_window_title_calls(mocker, method)
test_WindowsCollector__get_window_title_functionality(mocker, value)
test_WindowsCollector__init__calls_super(mocker)
test_WindowsCollector__init__initializes_Api_and_sets_it_as_attribute(mocker)
test_WindowsCollector__is_activable_calls_window_info_extended_style(mocker)
test_WindowsCollector__is_activable_return(mocker, value, expected)
test_WindowsCollector__is_alt_tab_applicable_calls_IsWindowVisible(mocker)
test_WindowsCollector__is_alt_tab_applicable_calls_get_ancestor_by_type(mocker)
test_WindowsCollector__is_alt_tab_applicable_calls_get_last_active_popup(mocker)
test_WindowsCollector__is_alt_tab_applicable_return_False(mocker)
test_WindowsCollector__is_alt_tab_applicable_return_True(mocker)
test_WindowsCollector__is_cloaked_calls_and_returns_is_cloaked(mocker)
test_WindowsCollector__is_tool_window_calls(mocker, method)
test_WindowsCollector__is_tool_window_return(mocker, value, expected)
test_WindowsCollector__is_tray_window_calls_title_info_state(mocker)
test_WindowsCollector__is_tray_window_return(mocker, value, expected)
test_WindowsCollector_add_window_calls_WindowsCollection_add(mocker)
test_WindowsCollector_add_window_calls_methods(mocker, method)
test_WindowsCollector_add_window_inits_WindowModel(mocker)
test_WindowsCollector_check_window_calls(mocker, method)
test_WindowsCollector_check_window_functionality(mocker, is_applicable, is_valid_state, expected)
test_WindowsCollector_get_application_name_calls(mocker, method)
test_WindowsCollector_get_application_name_calls_executable_name_for_hwnd(mocker)
test_WindowsCollector_get_application_name_existing_package(mocker)
test_WindowsCollector_get_application_name_functionality_no_package_no_app_name(mocker, value)
test_WindowsCollector_get_application_name_returns_GetClassName_for_exe_None(mocker)
test_WindowsCollector_get_application_name_returns_executable_name_for_hwnd(mocker)
test_WindowsCollector_get_available_calls_and_returns_api_get_desktops(mocker)
test_WindowsCollector_get_monitors_rects_calls_EnumDisplayMonitors(mocker)
test_WindowsCollector_get_monitors_rects_returns_list_of_rect_parts(mocker)
test_WindowsCollector_get_windows_calls_api_enum_windows(mocker)
test_WindowsCollector_get_workspace_number_for_window_returns_api_get_ordinal(mocker)
test_WindowsCollector_is_applicable_calls(mocker, method)
test_WindowsCollector_is_applicable_returns_False_for__is_tool_window(mocker)
test_WindowsCollector_is_applicable_returns_False_for__is_tray_window(mocker)
test_WindowsCollector_is_applicable_returns_False_for_not_IsWindow(mocker)
test_WindowsCollector_is_applicable_returns_False_for_not_IsWindowEnabled(mocker)
test_WindowsCollector_is_applicable_returns_False_for_not_IsWindowVisible(mocker)
test_WindowsCollector_is_applicable_returns_False_for_not__is_alt_tab_applicable(mocker)
test_WindowsCollector_is_applicable_returns_True(mocker)
test_WindowsCollector_is_resizable_calls(mocker, method)
test_WindowsCollector_is_resizable_return(mocker, value, expected)
test_WindowsCollector_is_restored_calls(mocker, method)
test_WindowsCollector_is_restored_return(mocker, value, expected)
test_WindowsCollector_is_valid_state_calls__is_activable(mocker)
test_WindowsCollector_is_valid_state_calls__is_cloaked(mocker)
test_WindowsCollector_is_valid_state_return_value_for_activable(mocker, method, value, expected)
test_WindowsCollector_is_valid_state_return_value_for_cloaked(mocker, method, value, expected)
test_WindowsCollector_run_functionality(mocker, is_applicable, is_valid_state, value)
class tests.unit.test_windows.TestWindowsController

Bases: object

Testing class for arrangeit.windows.controller.Controller class.

test_WindowsController_inits_screenshot_when_exposed_as_True()
test_WindowsController_setup_root_window_calls_root_overrideredirect(mocker)
test_WindowsController_setup_root_window_calls_super(mocker)
class tests.unit.test_windows.TestWindowsUtils

Bases: object

Testing class for arrangeit.windows.utils module.

test_windows_utils_module_extract_name_from_bytes_path_calls_basename(mocker)
test_windows_utils_module_extract_name_from_bytes_path_calls_splitext(mocker)
test_windows_utils_module_extract_name_from_bytes_path_decode(mocker)
test_windows_utils_module_extract_name_from_bytes_path_functionality(path, name)
test_windows_utils_module_extract_name_from_bytes_path_getdefaultencoding(mocker)
test_windows_utils_module_user_data_path(mocker)
tests.unit.test_windows_api – Unit tests for MS Windows api helpers module
class tests.unit.test_windows_api.TestDWM_THUMBNAIL_PROPERTIES

Bases: object

Testing class for arrangeit.windows.api.DWM_THUMBNAIL_PROPERTIES class.

test_windows_api_DWM_THUMBNAIL_PROPERTIES_field_and_type(field, typ)
test_windows_api_DWM_THUMBNAIL_PROPERTIES_inits__fields_()
test_windows_api_DWM_THUMBNAIL_PROPERTIES_is_Structure_subclass()
class tests.unit.test_windows_api.TestDummyVirtualDesktops

Bases: object

Testing class for arrangeit.windows.api.DummyVirtualDesktops.

test_api_DummyVirtualDesktops_defines_get_desktops(mocker)
test_api_DummyVirtualDesktops_defines_get_window_desktop(mocker)
test_api_DummyVirtualDesktops_defines_is_window_in_current_desktop(mocker)
test_api_DummyVirtualDesktops_defines_move_other_window_to_desktop(mocker)
test_api_DummyVirtualDesktops_defines_move_own_window_to_desktop(mocker)
class tests.unit.test_windows_api.TestPACKAGE_ID

Bases: object

Testing class for arrangeit.windows.api.PACKAGE_ID class.

test_windows_api_PACKAGE_ID_field_and_type(field, typ)
test_windows_api_PACKAGE_ID_inits__fields_()
test_windows_api_PACKAGE_ID_is_Structure_subclass()
class tests.unit.test_windows_api.TestPACKAGE_INFO

Bases: object

Testing class for arrangeit.windows.api.PACKAGE_INFO class.

test_windows_api_PACKAGE_INFO_field_and_type(field, typ)
test_windows_api_PACKAGE_INFO_inits__fields_()
test_windows_api_PACKAGE_INFO_is_Structure_subclass()
class tests.unit.test_windows_api.TestPACKAGE_INFO_REFERENCE

Bases: object

Testing class for arrangeit.windows.api.PACKAGE_INFO_REFERENCE class.

test_windows_api_PACKAGE_INFO_REFERENCE_field_and_type(field, typ)
test_windows_api_PACKAGE_INFO_REFERENCE_inits__fields_()
test_windows_api_PACKAGE_INFO_REFERENCE_is_Structure_subclass()
class tests.unit.test_windows_api.TestPACKAGE_SUBVERSION

Bases: object

Testing class for arrangeit.windows.api.PACKAGE_SUBVERSION class.

test_windows_api_PACKAGE_SUBVERSION_field_and_type(field, typ)
test_windows_api_PACKAGE_SUBVERSION_inits__fields_()
test_windows_api_PACKAGE_SUBVERSION_is_Structure_subclass()
class tests.unit.test_windows_api.TestPACKAGE_VERSION

Bases: object

Testing class for arrangeit.windows.api.PACKAGE_VERSION class.

test_windows_api_PACKAGE_VERSION_field_and_type(field, typ)
test_windows_api_PACKAGE_VERSION_inits__anonymous_()
test_windows_api_PACKAGE_VERSION_inits__fields_()
test_windows_api_PACKAGE_VERSION_is_Structure_subclass()
class tests.unit.test_windows_api.TestPACKAGE_VERSION_U

Bases: object

Testing class for arrangeit.windows.api.PACKAGE_VERSION_U class.

test_windows_api_PACKAGE_VERSION_U_field_and_type(field, typ)
test_windows_api_PACKAGE_VERSION_U_inits__fields_()
test_windows_api_PACKAGE_VERSION_U_is_Union_subclass()
class tests.unit.test_windows_api.TestTITLEBARINFO

Bases: object

Testing class for arrangeit.windows.api.TITLEBARINFO class.

test_windows_api_TITLEBARINFO_field_and_type(field, typ)
test_windows_api_TITLEBARINFO_inits__fields_()
test_windows_api_TITLEBARINFO_is_Structure_subclass()
class tests.unit.test_windows_api.TestWINDOWINFO

Bases: object

Testing class for arrangeit.windows.api.WINDOWINFO class.

test_windows_api_WINDOWINFO_field_and_type(field, typ)
test_windows_api_WINDOWINFO_inits__fields_()
test_windows_api_WINDOWINFO_is_Structure_subclass()
class tests.unit.test_windows_api.TestWindowsApiCustomFunctions

Bases: object

Testing class for arrangeit.windows.api custom functions.

test_windows_api_platform_supports_packages_calls_getwindowsversion(mocker)
test_windows_api_platform_supports_packages_for_exception(mocker)
test_windows_api_platform_supports_packages_functionality(mocker, major, minor, expected)
test_windows_api_platform_supports_virtual_desktops_calls_getwindowsversion(mocker)
test_windows_api_platform_supports_virtual_desktops_for_exception(mocker)
test_windows_api_platform_supports_virtual_desktops_functionality(mocker, major, minor, expected)
class tests.unit.test_windows_api.TestWindowsApiHelpersCommon

Bases: object

Testing class for arrangeit.windows.api.Helpers common methods.

test_windows_api_Helpers___init___calls__setup_base(mocker)
test_windows_api_Helpers___init___calls__setup_common_helpers(mocker)
test_windows_api_Helpers___init___calls__setup_thumbnail_helpers(mocker)
test_windows_api_Helpers___init___calls__setup_win8_helpers(mocker)
test_windows_api_Helpers___init___calls_platform_supports_packages(mocker)
test_windows_api_Helpers___init__not_calling__setup_win8_helpers(mocker)
test_windows_api_Helpers__setup_base_sets_WNDENUMPROC(mocker)
test_windows_api_Helpers__setup_base_sets_WinDLL_dwmapi(mocker)
test_windows_api_Helpers__setup_base_sets_WinDLL_kernel32(mocker)
test_windows_api_Helpers__setup_base_sets_WinDLL_psapi(mocker)
test_windows_api_Helpers__setup_base_sets_WinDLL_user32(mocker)
test_windows_api_Helpers__setup_common__get_windows_thread_process_id(mocker)
test_windows_api_Helpers__setup_common_helpers__close_handle(mocker)
test_windows_api_Helpers__setup_common_helpers__dwm_get_window_attribute(mocker)
test_windows_api_Helpers__setup_common_helpers__enum_child_windows(mocker)
test_windows_api_Helpers__setup_common_helpers__enum_windows(mocker)
test_windows_api_Helpers__setup_common_helpers__get_ancestor(mocker)
test_windows_api_Helpers__setup_common_helpers__get_last_active_popup(mocker)
test_windows_api_Helpers__setup_common_helpers__get_process_image_file_name(mocker)
test_windows_api_Helpers__setup_common_helpers__get_titlebar_info(mocker)
test_windows_api_Helpers__setup_common_helpers__get_window_info(mocker)
test_windows_api_Helpers__setup_common_helpers__open_process(mocker)
test_windows_api_Helpers__setup_helper_returns_attr_method(mocker)
test_windows_api_Helpers__setup_helper_sets_argtypes(mocker)
test_windows_api_Helpers__setup_helper_sets_restype(mocker)
test_windows_api_Helpers__setup_thumbnail_help__dwm_update_thumbnail_properties(mocker)
test_windows_api_Helpers__setup_thumbnail_helpers__dwm_is_composition_enabled(mocker)
test_windows_api_Helpers__setup_thumbnail_helpers__dwm_register_thumbnail(mocker)
test_windows_api_Helpers__setup_thumbnail_helpers__dwm_unregister_thumbnail(mocker)
class tests.unit.test_windows_api.TestWindowsApiHelpersWin8

Bases: object

Testing class for arrangeit.windows.api.Helpers Win8+ functions.

pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'Win 8 and 10 only'})]
test_windows_api_Helpers__setup_win8_helpers__close_package_info(mocker)
test_windows_api_Helpers__setup_win8_helpers__get_package_full_name(mocker)
test_windows_api_Helpers__setup_win8_helpers__get_package_info(mocker)
test_windows_api_Helpers__setup_win8_helpers__open_package_info_by_full_name(mocker)
class tests.unit.test_windows_api.TestWindowsApiPackage

Bases: object

Testing class for arrangeit.windows.api.Package.

test_api_Package__get_first_image_calls_and_returns_resized_Image(mocker)
test_api_Package__get_first_image_calls_open_image_if_not_exists(mocker)
test_api_Package__get_first_image_calls_os_path_exists(mocker)
test_api_Package__get_first_image_calls_os_path_join(mocker)
test_api_Package__get_first_image_calls_product(mocker)
test_api_Package__get_first_image_calls_splitext(mocker)
test_api_Package__get_first_image_catches_exception(mocker)
test_api_Package__get_manifest_root_calls_and_returns_getroot(mocker)
test_api_Package__get_manifest_root_calls_os_path_exists(mocker)
test_api_Package__get_manifest_root_calls_os_path_join(mocker)
test_api_Package__get_manifest_root_calls_parse(mocker)
test_api_Package__get_manifest_root_returns_true_if_not_exists(mocker)
test_api_Package__init__calls_setup_package(mocker)
test_api_Package__init__sets_path_attribute_from_provided(mocker)
test_api_Package__namespace_for_element_calls_re_match(mocker)
test_api_Package__namespace_for_element_returns_empty_string(mocker)
test_api_Package__namespace_for_element_returns_first_group(mocker)
test_api_Package__setup_app_name_calls__namespace_for_element(mocker)
test_api_Package__setup_app_name_calls_iter_on_next(mocker)
test_api_Package__setup_app_name_calls_next(mocker)
test_api_Package__setup_app_name_calls_root_iter(mocker)
test_api_Package__setup_app_name_sets_app_name_attr(mocker)
test_api_Package__setup_icon_appends_once_to_sources_from_Applications(mocker)
test_api_Package__setup_icon_appends_to_sources_from_Properties(mocker)
test_api_Package__setup_icon_calls__namespace_for_element(mocker)
test_api_Package__setup_icon_calls_iter_on_next(mocker)
test_api_Package__setup_icon_calls_next(mocker)
test_api_Package__setup_icon_calls_root_iter(mocker)
test_api_Package_inits_empty_attr(attr)
test_api_Package_inits_empty_icon()
test_api_Package_setup_package_calls__get_manifest_root(mocker)
test_api_Package_setup_package_calls__setup_app_name(mocker)
test_api_Package_setup_package_calls__setup_icon(mocker)
tests.unit.test_windows_vdi – Unit tests for MS Windows virtual desktop interfaces module
class tests.unit.test_windows_vdi.TestWindowsVdiAdjacentDesktop

Bases: object

Testing class for arrangeit.windows.vdi.AdjacentDesktop class.

test_windows_vdi_AdjacentDesktop_field_and_value(field, value)
test_windows_vdi_AdjacentDesktop_is_INT_subclass()
class tests.unit.test_windows_vdi.TestWindowsVdiApplicationViewOrientation

Bases: object

Testing class for arrangeit.windows.vdi.ApplicationViewOrientation class.

test_windows_vdi_ApplicationViewOrientation_field_and_value(field, value)
test_windows_vdi_ApplicationViewOrientation_is_INT_subclass()
class tests.unit.test_windows_vdi.TestWindowsVdiEventRegistrationToken

Bases: object

Testing class for arrangeit.windows.vdi.EventRegistrationToken class.

test_windows_api_EventRegistrationToken_field_and_type(field, typ)
test_windows_api_EventRegistrationToken_inits__fields_()
test_windows_vdi_EventRegistrationToken_is_Structure_subclass()
class tests.unit.test_windows_vdi.TestWindowsVdiHSTRING__

Bases: object

Testing class for arrangeit.windows.vdi.HSTRING__ class.

test_windows_api_HSTRING___field_and_type(field, typ)
test_windows_api_HSTRING___inits__fields_()
test_windows_vdi_HSTRING___is_Structure_subclass()
class tests.unit.test_windows_vdi.TestWindowsVdiIApplicationView

Bases: object

Testing class for arrangeit.windows.vdi.IApplicationView class.

test_windows_vdi_IApplicationView_field_and_value(field, value)
test_windows_vdi_IApplicationView_is_IInspectable_subclass()
test_windows_vdi_IApplicationView_method_add_Consolidated()
test_windows_vdi_IApplicationView_method_get_AdjacentToLeftDisplayEdge()
test_windows_vdi_IApplicationView_method_get_AdjacentToRightDisplayEdge()
test_windows_vdi_IApplicationView_method_get_Id()
test_windows_vdi_IApplicationView_method_get_IsFullScreen()
test_windows_vdi_IApplicationView_method_get_IsOnLockScreen()
test_windows_vdi_IApplicationView_method_get_IsScreenCaptureEnabled()
test_windows_vdi_IApplicationView_method_get_Orientation()
test_windows_vdi_IApplicationView_method_get_Title()
test_windows_vdi_IApplicationView_method_put_IsScreenCaptureEnabled()
test_windows_vdi_IApplicationView_method_put_Title()
test_windows_vdi_IApplicationView_method_remove_Consolidated()
class tests.unit.test_windows_vdi.TestWindowsVdiIApplicationViewCollection

Bases: object

Testing class for arrangeit.windows.vdi.IApplicationViewCollection class.

test_windows_vdi_IApplicationViewCollection_RegisterForApplicationViewChanges()
test_windows_vdi_IApplicationViewCollection_UnregisterForApplicationViewChanges()
test_windows_vdi_IApplicationViewCollection_field_and_value(field, value)
test_windows_vdi_IApplicationViewCollection_is_IUnknown_subclass()
test_windows_vdi_IApplicationViewCollection_method_GetViewForAppUserModelId()
test_windows_vdi_IApplicationViewCollection_method_GetViewForApplication()
test_windows_vdi_IApplicationViewCollection_method_GetViewForHwnd()
test_windows_vdi_IApplicationViewCollection_method_GetViewInFocus()
test_windows_vdi_IApplicationViewCollection_method_GetViews()
test_windows_vdi_IApplicationViewCollection_method_GetViewsByAppUserModelId()
test_windows_vdi_IApplicationViewCollection_method_GetViewsByZOrder()
test_windows_vdi_IApplicationViewCollection_method_RefreshCollection()
test_windows_vdi_IApplicationViewCollection_method_Unknown1()
class tests.unit.test_windows_vdi.TestWindowsVdiIApplicationViewConsolidatedEventArgs

Bases: object

Testing class for arrangeit.windows.vdi.IApplicationViewConsolidatedEventArgs class.

test_windows_vdi_IApplicationViewConsolidatedEventArgs_field_and_value(field, value)
test_windows_vdi_IApplicationViewConsolidatedEventArgs_is_IInspectable_subclass()
test_windows_vdi_IApplicationViewConsolidatedEventArgs_m_get_IsUserInitiated()
class tests.unit.test_windows_vdi.TestWindowsVdiIInspectable

Bases: object

Testing class for arrangeit.windows.vdi.IInspectable class.

test_windows_vdi_IInspectable_field_and_value(field, value)
test_windows_vdi_IInspectable_is_IUnknown_subclass()
test_windows_vdi_IInspectable_method_GetIids()
test_windows_vdi_IInspectable_method_GetRuntimeClassName()
test_windows_vdi_IInspectable_method_GetTrustLevel()
class tests.unit.test_windows_vdi.TestWindowsVdiIObjectArray

Bases: object

Testing class for arrangeit.windows.vdi.IObjectArray class.

test_windows_vdi_IObjectArray_field_and_value(field, value)
test_windows_vdi_IObjectArray_is_IUnknown_subclass()
test_windows_vdi_IObjectArray_method_GetAt()
test_windows_vdi_IObjectArray_method_GetCount()
class tests.unit.test_windows_vdi.TestWindowsVdiIServiceProvider

Bases: object

Testing class for arrangeit.windows.vdi.IServiceProvider class.

test_windows_vdi_IServiceProvider_field_and_value(field, value)
test_windows_vdi_IServiceProvider_is_IUnknown_subclass()
test_windows_vdi_IServiceProvider_method_QueryService()
class tests.unit.test_windows_vdi.TestWindowsVdiIVirtualDesktop

Bases: object

Testing class for arrangeit.windows.vdi.IVirtualDesktop class.

test_windows_vdi_IVirtualDesktop_field_and_value(field, value)
test_windows_vdi_IVirtualDesktop_is_IUnknown_subclass()
test_windows_vdi_IVirtualDesktop_method_GetID()
test_windows_vdi_IVirtualDesktop_method_IsViewVisible()
class tests.unit.test_windows_vdi.TestWindowsVdiIVirtualDesktopManager

Bases: object

Testing class for arrangeit.windows.vdi.IVirtualDesktopManager class.

test_windows_vdi_IVirtualDesktopManager_field_and_value(field, value)
test_windows_vdi_IVirtualDesktopManager_is_IUnknown_subclass()
test_windows_vdi_IVirtualDesktopManager_method_GetWindowDesktopId()
test_windows_vdi_IVirtualDesktopManager_method_IsWindowOnCurrentVirtualDesktop()
test_windows_vdi_IVirtualDesktopManager_method_MoveWindowToDesktop()
class tests.unit.test_windows_vdi.TestWindowsVdiIVirtualDesktopManagerInternal

Bases: object

Testing class for arrangeit.windows.vdi.IVirtualDesktopManagerInternal class.

test_windows_vdi_IVirtualDesktopManagerInternal_field_and_value(field, value)
test_windows_vdi_IVirtualDesktopManagerInternal_is_IUnknown_subclass()
test_windows_vdi_IVirtualDesktopManagerInternal_method_CanViewMoveDesktops()
test_windows_vdi_IVirtualDesktopManagerInternal_method_CreateDesktopW()
test_windows_vdi_IVirtualDesktopManagerInternal_method_FindDesktop()
test_windows_vdi_IVirtualDesktopManagerInternal_method_GetAdjacentDesktop()
test_windows_vdi_IVirtualDesktopManagerInternal_method_GetCount()
test_windows_vdi_IVirtualDesktopManagerInternal_method_GetCurrentDesktop()
test_windows_vdi_IVirtualDesktopManagerInternal_method_GetDesktops()
test_windows_vdi_IVirtualDesktopManagerInternal_method_MoveViewToDesktop()
test_windows_vdi_IVirtualDesktopManagerInternal_method_RemoveDesktop()
test_windows_vdi_IVirtualDesktopManagerInternal_method_SwitchDesktop()
class tests.unit.test_windows_vdi.TestWindowsVdiModuleUids

Bases: object

Testing class for arrangeit.windows.vdi module level attributes.

test_windows_vdi_module_instantiates_clsid_attribute(attr, uid)
test_windows_vdi_module_instantiates_iid_attribute(attr, uid)
class tests.unit.test_windows_vdi.TestWindowsVdiTrustLevel

Bases: object

Testing class for arrangeit.windows.vdi.TrustLevel class.

test_windows_vdi_TrustLevel_field_and_value(field, value)
test_windows_vdi_TrustLevel_is_INT_subclass()
class tests.unit.test_windows_vdi.TestWindowsVdiVirtualDesktopsWin10

Bases: object

Testing class for arrangeit.windows.vdi.VirtualDesktopsWin10 class.

pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'Win 10 only'})]
test_windows_vdi_VDWin10__get_desktop_id_from_array_calls_POINTER(mocker)
test_windows_vdi_VDWin10__get_desktop_id_from_array_calls__and_returns_GetID(mocker)
test_windows_vdi_VDWin10__get_desktop_id_from_array_calls_array_GetAt(mocker)
test_windows_vdi_VDWin10__get_desktop_id_from_array_calls_byref(mocker)
test_windows_vdi_VDWin10__get_desktop_id_from_array_instantiates_POINTER(mocker)
test_windows_vdi_VDWin10__get_desktop_id_from_ordinal_calls_get_desktops(mocker)
test_windows_vdi_VDWin10__get_desktop_id_from_ordinal_functionality(mocker, ordinal, expected)
test_windows_vdi_VDWin10__get_desktops_calls_GetCount(mocker)
test_windows_vdi_VDWin10__get_desktops_calls_GetDesktops(mocker)
test_windows_vdi_VDWin10__get_desktops_calls__get_desktop_id_from_array(mocker)
test_windows_vdi_VDWin10__get_desktops_returns_list(mocker)
test_windows_vdi_VDWin10__get_internal_manager_calls_POINTER(mocker)
test_windows_vdi_VDWin10__get_internal_manager_calls_QueryService(mocker)
test_windows_vdi_VDWin10__get_internal_manager_calls_and_returns_ctypes_cast(mocker)
test_windows_vdi_VDWin10__get_manager_calls_and_returns_CoCreateInstance(mocker)
test_windows_vdi_VDWin10__get_service_provider_calls_and_returns_CoCreateInstance(mocker)
test_windows_vdi_VDWin10__get_view_collection_calls_POINTER(mocker)
test_windows_vdi_VDWin10__get_view_collection_calls_QueryService(mocker)
test_windows_vdi_VDWin10__get_view_collection_calls_and_returns_ctypes_cast(mocker)
test_windows_vdi_VDWin10_get_desktops_calls__get_desktops_for_None(mocker)
test_windows_vdi_VDWin10_get_desktops_calls__get_desktops_for_refresh_True(mocker)
test_windows_vdi_VDWin10_get_desktops_not_calling__get_desktops(mocker)
test_windows_vdi_VDWin10_get_window_desktop_calls_GetWindowDesktopId(mocker)
test_windows_vdi_VDWin10_get_window_desktop_calls_get_desktops(mocker)
test_windows_vdi_VDWin10_get_window_desktop_calls_next(mocker)
test_windows_vdi_VDWin10_get_window_desktop_returns_0_None_for_no_desktop(mocker)
test_windows_vdi_VDWin10_get_window_desktop_returns_tuple(mocker)
test_windows_vdi_VDWin10_is_window_in_current_desktop_calls_IsWindowOnCurrent(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_calls_FindDesktop(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_calls_GetViewForHwnd(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_calls_MoveViewToDesktop(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_calls_byref(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_get_desktop_id_from_ord(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_returns_False(mocker)
test_windows_vdi_VDWin10_move_other_window_to_desktop_returns_None_for_not_ok(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_calls_FindDesktop(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_calls_MoveWindowToDesktop(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_calls_SwitchDesktop(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_calls_byref(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_calls_byref_find(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_get_desktop_id_from_ordinal(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_returns_False(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_returns_None_for_Switch(mocker)
test_windows_vdi_VDWin10_move_own_window_to_desktop_returns_None_for_move_not_ok(mocker)
test_windows_vdi_VirtualDesktopsWin10__init__calls_setup(mocker)
test_windows_vdi_VirtualDesktopsWin10__setup_calls_CoInitialize(mocker)
test_windows_vdi_VirtualDesktopsWin10__setup_calls__get_internal_manager_attr(mocker)
test_windows_vdi_VirtualDesktopsWin10__setup_calls__get_manager_and_sets_attr(mocker)
test_windows_vdi_VirtualDesktopsWin10__setup_calls__get_service_provider(mocker)
test_windows_vdi_VirtualDesktopsWin10__setup_calls__get_view_collection_attr(mocker)
test_windows_vdi_VirtualDesktopsWin10_inits_attr_as_None(attr)
tests.unit.test_windows_api_api – Unit tests for MS Windows api helpers module Api class
class tests.unit.test_windows_api_api.TestWindowsApiApiPrivate

Bases: object

Testing class for arrangeit.windows.api.Api private methods.

test_api_Api__rectangle_to_wintypes_rect_calls_and_returns_wintypes_RECT(mocker)
test_api_Api__rectangle_to_wintypes_rect_sets_attributtes(mocker)
test_api_Api__update_thumbnail_calls_DWM_THUMBNAIL_PROPERTIES(mocker)
test_api_Api__update_thumbnail_calls__dwm_update_thumbnail_properties(mocker)
test_api_Api__update_thumbnail_calls__rectangle_to_wintypes_rect(mocker)
test_api_Api__update_thumbnail_calls_returns_None(mocker)
test_api_Api__update_thumbnail_calls_returns_thumbnail_id(mocker)
test_api_Api__update_thumbnail_calls_wintypes_BYTE(mocker)
test_api_Api__update_thumbnail_calls_wintypes_byref(mocker)
test_api_Api__update_thumbnail_sets_dwFlags(mocker)
test_api_Api__update_thumbnail_sets_fSourceClientAreaOnly(mocker)
test_api_Api__update_thumbnail_sets_fVisible(mocker)
test_api_Api__update_thumbnail_sets_opacity(mocker)
test_api_Api__update_thumbnail_sets_rcDestination(mocker)
test_api_Api__update_thumbnail_sets_rcSource(mocker)
test_api_Api__wintypes_rect_to_rectangle_calls_and_returns_Rectangle(mocker)
class tests.unit.test_windows_api_api.TestWindowsApiApiPrivateWin8

Bases: object

Testing class for arrangeit.windows.api.Api Win8+ private methods.

pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'Win 8 and 10 only'})]
test_Api__package_full_name_from_handle_calls_again__get_package_full_name(mocker)
test_Api__package_full_name_from_handle_calls_create_unicode_buffer(mocker)
test_Api__package_full_name_from_handle_calls_first_time__get_package_full_name(mocker)
test_Api__package_full_name_from_handle_returns_None_for_no_package(mocker)
test_Api__package_full_name_from_handle_returns_None_for_no_success(mocker)
test_Api__package_full_name_from_handle_returns_full_name(mocker)
test_Api__package_full_name_from_hwnd_calls__close_handle(mocker)
test_Api__package_full_name_from_hwnd_calls__get_windows_thread_process_id(mocker)
test_Api__package_full_name_from_hwnd_calls__open_process(mocker)
test_Api__package_full_name_from_hwnd_calls__package_full_name_from_handle(mocker)
test_Api__package_full_name_from_hwnd_calls_enum_windows(mocker)
test_Api__package_full_name_from_hwnd_calls_wintypes_DWORD(mocker)
test_Api__package_full_name_from_hwnd_returns_None(mocker)
test_Api__package_full_name_from_hwnd_returns_full_name(mocker)
test_Api__package_info_buffer_from_reference_calls_again__get_package_info(mocker)
test_Api__package_info_buffer_from_reference_calls_cast(mocker)
test_Api__package_info_buffer_from_reference_calls_create_string_buffer(mocker)
test_Api__package_info_buffer_from_reference_calls_first_time__get_package_info(mocker)
test_Api__package_info_buffer_from_reference_returns_None_for_no_success(mocker)
test_Api__package_info_buffer_from_reference_returns_None_for_not_insufficient(mocker)
test_Api__package_info_buffer_from_reference_returns_buffer(mocker)
test_Api__package_info_ref_from_full_name_calls__open_package_info_by_full_name(mocker)
test_Api__package_info_reference_from_full_name_calls_PACKAGE_INFO_REFERENCE(mocker)
test_Api__package_info_reference_from_full_name_calls_pointer(mocker)
test_Api__package_info_reference_from_full_name_returns_None(mocker)
test_Api__package_info_reference_from_full_name_returns_package_info_reference(mocker)
class tests.unit.test_windows_api_api.TestWindowsApiApiPublic

Bases: object

Testing class for arrangeit.windows.api.Api public methods.

test_Api_executable_name_for_hwnd_calls__close_handle(mocker)
test_Api_executable_name_for_hwnd_calls__get_process_image_file_name(mocker)
test_Api_executable_name_for_hwnd_calls__get_windows_thread_process_id(mocker)
test_Api_executable_name_for_hwnd_calls__open_process(mocker)
test_Api_executable_name_for_hwnd_calls_and_returns_extract_name_from_bytes_path(mocker)
test_Api_executable_name_for_hwnd_calls_create_string_buffer(mocker)
test_Api_executable_name_for_hwnd_calls_wintypes_DWORD(mocker)
test_Api_executable_name_for_hwnd_returns_None(mocker)
test_Api_extended_frame_rect_calls__dwm_get_window_attribute(mocker)
test_Api_extended_frame_rect_calls_and_returns_wintypes_rect_to_rectangle(mocker)
test_Api_extended_frame_rect_calls_ctypes_byref(mocker)
test_Api_extended_frame_rect_calls_ctypes_sizeof(mocker)
test_Api_extended_frame_rect_calls_wintypes_RECT(mocker)
test_Api_extended_frame_rect_returns_None(mocker)
test_Api_get_ancestor_by_type_calls_and_returns__get_ancestor(mocker)
test_Api_get_desktop_ordinal_for_window_calls_dummy_vdi_get_window_desktop(mocker)
test_Api_get_desktop_ordinal_for_window_calls_win10_vdi_get_window_desktop(mocker)
test_Api_get_desktops_calls_dummy_vdi_get_desktops(mocker)
test_Api_get_desktops_calls_win10_vdi_get_desktops(mocker)
test_Api_get_desktops_returns_list_of_two_tuples(mocker)
test_Api_get_last_active_popup_calls_and_returns__get_ancestor(mocker)
test_Api_is_cloaked_calls__dwm_get_window_attribute(mocker)
test_Api_is_cloaked_calls_and_returns_vdi_is_window_in_current_for_dwm_value_dummy(mocker)
test_Api_is_cloaked_calls_and_returns_vdi_is_window_in_current_for_dwm_value_win10(mocker)
test_Api_is_cloaked_calls_ctypes_byref(mocker)
test_Api_is_cloaked_calls_ctypes_sizeof(mocker)
test_Api_is_cloaked_calls_wintypes_DWORD(mocker)
test_Api_is_cloaked_returns_False_for_0_dwm_value(mocker)
test_Api_is_cloaked_returns_False_for_not_ok(mocker)
test_Api_is_dwm_composition_enabled_calls__dwm_is_composition_enabled(mocker)
test_Api_is_dwm_composition_enabled_calls_ctypes_byref(mocker)
test_Api_is_dwm_composition_enabled_calls_wintypes_BOOL(mocker)
test_Api_is_dwm_composition_enabled_returns_value(mocker)
test_Api_move_other_window_to_desktop_calls_dummy_vdi_move_other_window_to_desktop(mocker)
test_Api_move_other_window_to_desktop_calls_win10_vdi_move_other_window_to(mocker)
test_Api_move_own_window_to_desktop_calls_dummy_vdi_move_own_window_to_desktop(mocker)
test_Api_move_own_window_to_desktop_calls_win10_vdi_move_own_window_to_desktop(mocker)
test_Api_setup_thumbnail_calls__dwm_register_thumbnail(mocker)
test_Api_setup_thumbnail_calls_and_returns__update_thumbnail(mocker)
test_Api_setup_thumbnail_calls_wintypes_HANDLE(mocker)
test_Api_setup_thumbnail_calls_wintypes_byref(mocker)
test_Api_setup_thumbnail_returns_None(mocker)
test_Api_title_info_state_calls_TITLEBARINFO(mocker)
test_Api_title_info_state_calls__get_titlebar_info(mocker)
test_Api_title_info_state_calls_ctypes_byref(mocker)
test_Api_title_info_state_calls_ctypes_sizeof(mocker)
test_Api_title_info_state_returns_None(mocker)
test_Api_title_info_state_returns_value(mocker)
test_Api_unregister_thumbnail_calls__dwm_unregister_thumbnail(mocker)
test_Api_unregister_thumbnail_returns_True_on_error(mocker)
test_Api_window_info_extended_style_calls_WINDOWINFO(mocker)
test_Api_window_info_extended_style_calls__get_window_info(mocker)
test_Api_window_info_extended_style_calls_ctypes_byref(mocker)
test_Api_window_info_extended_style_returns_None(mocker)
test_Api_window_info_extended_style_returns_value(mocker)
test_api_Api__init__calls_platform_supports_virtual_desktops(mocker)
test_api_Api__init__initializes_and_sets_dummy_vdi(mocker)
test_api_Api__init__initializes_and_sets_helpers(mocker)
test_api_Api__init__initializes_and_sets_vdi(mocker)
test_api_Api_enum_windows_calls_WNDENUMPROC(mocker)
test_api_Api_enum_windows_calls__enum_child_windows(mocker)
test_api_Api_enum_windows_calls__enum_windows(mocker)
test_api_Api_enum_windows_nested_append_to_collection(mocker)
test_api_Api_enum_windows_returns_non_empty_list(mocker)
test_api_Api_inits_attr_as_None(attr)
test_api_Api_inits_empty_attr(attr)
class tests.unit.test_windows_api_api.TestWindowsApiApiPublicWin8

Bases: object

Testing class for arrangeit.windows.api.Api Win8 and 10 public methods.

pytestmark = [Mark(name='skipif', args=(True,), kwargs={'reason': 'Win 8 and 10 only'})]
test_api_Api_get_package_calls_PACKAGE_INFO_from_buffer(mocker)
test_api_Api_get_package_calls_Package(mocker)
test_api_Api_get_package_calls__close_package_info(mocker)
test_api_Api_get_package_calls__package_full_name_from_hwnd(mocker)
test_api_Api_get_package_calls__package_info_buffer_from_reference(mocker)
test_api_Api_get_package_calls__package_info_reference_from_full_name(mocker)
test_api_Api_get_package_returns_empty_Package(mocker)
tests.unit.fixtures – Sample fixtures for unit testing
tests.unit.mock_helpers – Unit testing mock helper functions
tests.unit.mock_helpers.controller_mocked_app(mocker)
tests.unit.mock_helpers.controller_mocked_for_next(mocker)
tests.unit.mock_helpers.controller_mocked_for_run(mocker)
tests.unit.mock_helpers.controller_mocked_key_press(mocker, key)
tests.unit.mock_helpers.controller_mocked_next(mocker)
tests.unit.mock_helpers.mocked_for_about(mocker)
tests.unit.mock_helpers.mocked_for_about_setup(mocker)
tests.unit.mock_helpers.mocked_for_options(mocker)
tests.unit.mock_helpers.mocked_for_options_setup(mocker, without_section=False, without_files=False)
tests.unit.mock_helpers.mocked_setup(mocker)
tests.unit.mock_helpers.mocked_setup_root(mocker)
tests.unit.mock_helpers.mocked_setup_view(mocker)
tests.unit.nested_helper – Helper module for unit testing of inner/nested functions
tests.unit.nested_helper.freeVar(val)
tests.unit.nested_helper.nested(outer, innerName, **freeVars)

tests.functional – arrangeit functional tests

tests.functional.arrangeit_keywords – arrangeit keywords library for Robot Framework

tests.vm – Vagrant’s virtual machines for running tests in various environments

Indices and tables