-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move fixtures for modules into submodule (#24)
- Loading branch information
Showing
23 changed files
with
460 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Fixtures for modules.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"""Fixture for battery module.""" | ||
from systembridgemodels.modules.battery import Battery | ||
|
||
FIXTURE_BATTERY = Battery( | ||
is_charging=True, | ||
percentage=98.4, | ||
time_remaining=12, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
"""Fixture for cpu module.""" | ||
from systembridgemodels.modules.cpu import CPU, CPUFrequency, CPUStats, CPUTimes, PerCPU | ||
|
||
FIXTURE_CPU = CPU( | ||
count=4, | ||
frequency=CPUFrequency( | ||
current=2.3, | ||
min=0.8, | ||
max=3.1, | ||
), | ||
load_average=1.5, | ||
per_cpu=[ | ||
PerCPU( | ||
id=0, | ||
frequency=CPUFrequency( | ||
current=2.3, | ||
min=0.8, | ||
max=3.1, | ||
), | ||
power=50.0, | ||
times=CPUTimes( | ||
user=120.0, | ||
system=30.0, | ||
idle=600.0, | ||
interrupt=0.0, | ||
dpc=0.0, | ||
), | ||
times_percent=CPUTimes( | ||
user=20.0, | ||
system=5.0, | ||
idle=100.0, | ||
interrupt=0.0, | ||
dpc=0.0, | ||
), | ||
usage=20.0, | ||
voltage=1.2, | ||
) | ||
], | ||
power=200.0, | ||
stats=CPUStats( | ||
ctx_switches=1000, | ||
interrupts=500, | ||
soft_interrupts=200, | ||
syscalls=8000, | ||
), | ||
temperature=45.0, | ||
times=CPUTimes( | ||
user=480.0, | ||
system=120.0, | ||
idle=2400.0, | ||
interrupt=0.0, | ||
dpc=0.0, | ||
), | ||
times_percent=CPUTimes( | ||
user=80.0, | ||
system=20.0, | ||
idle=400.0, | ||
interrupt=0.0, | ||
dpc=0.0, | ||
), | ||
usage=80.0, | ||
voltage=1.2, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""Test fixtures for the disks module.""" | ||
from systembridgemodels.modules.disks import ( | ||
Disk, | ||
DiskIOCounters, | ||
DiskPartition, | ||
Disks, | ||
DiskUsage, | ||
) | ||
|
||
FIXTURE_DISKS = Disks( | ||
devices=[ | ||
Disk( | ||
name="name", | ||
partitions=[ | ||
DiskPartition( | ||
device="device", | ||
mount_point="mountpoint", | ||
filesystem_type="fstype", | ||
options="options", | ||
max_file_size=1, | ||
max_path_length=2, | ||
usage=DiskUsage( | ||
total=1, | ||
used=2, | ||
free=3, | ||
percent=40.2, | ||
), | ||
), | ||
], | ||
io_counters=DiskIOCounters( | ||
read_bytes=1, | ||
write_bytes=2, | ||
read_count=3, | ||
write_count=4, | ||
read_time=5, | ||
write_time=6, | ||
), | ||
) | ||
], | ||
io_counters=DiskIOCounters( | ||
read_bytes=1, | ||
write_bytes=2, | ||
read_count=3, | ||
write_count=4, | ||
read_time=5, | ||
write_time=6, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Fixtures for displays module.""" | ||
from systembridgemodels.modules.displays import Display | ||
|
||
FIXTURE_DISPLAYS = [ | ||
Display( | ||
id="abc123", | ||
name="name", | ||
resolution_horizontal=1920, | ||
resolution_vertical=1080, | ||
x=1920, | ||
y=1080, | ||
width=1920, | ||
height=1080, | ||
is_primary=True, | ||
pixel_clock=60.0, | ||
refresh_rate=60.0, | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Fixtures for GPU models.""" | ||
from systembridgemodels.modules.gpus import GPU | ||
|
||
FIXTURE_GPUS = [ | ||
GPU( | ||
id="abc123", | ||
name="name", | ||
core_clock=1000.0, | ||
core_load=100.0, | ||
fan_speed=100.0, | ||
memory_clock=1000.0, | ||
memory_load=100.0, | ||
memory_free=1000.0, | ||
memory_used=1000.0, | ||
memory_total=1000.0, | ||
power_usage=100.0, | ||
temperature=100.0, | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Fixtures for media models.""" | ||
from systembridgemodels.modules.media import Media | ||
|
||
FIXTURE_MEDIA = Media( | ||
album_artist="Album Artist", | ||
album_title="Album Title", | ||
artist="Artist", | ||
duration=100, | ||
is_fast_forward_enabled=True, | ||
is_next_enabled=True, | ||
is_pause_enabled=True, | ||
is_play_enabled=True, | ||
is_previous_enabled=True, | ||
is_rewind_enabled=True, | ||
is_stop_enabled=True, | ||
playback_rate=1.0, | ||
position=100, | ||
repeat="repeat", | ||
shuffle=True, | ||
status="status", | ||
subtitle="subtitle", | ||
thumbnail="thumbnail", | ||
title="title", | ||
track_number=1, | ||
type="type", | ||
updated_at=100, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Fixture for memory module.""" | ||
from systembridgemodels.modules.memory import Memory, MemorySwap, MemoryVirtual | ||
|
||
FIXTURE_MEMORY = Memory( | ||
swap=MemorySwap( | ||
total=1000, | ||
used=500, | ||
free=500, | ||
percent=50.0, | ||
sin=100, | ||
sout=100, | ||
), | ||
virtual=MemoryVirtual( | ||
total=1000, | ||
available=500, | ||
percent=50.0, | ||
used=500, | ||
free=500, | ||
active=500, | ||
inactive=500, | ||
buffers=500, | ||
cached=500, | ||
wired=500, | ||
shared=500, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"""Fixture for networks module.""" | ||
|
||
from systembridgemodels.modules.networks import ( | ||
Network, | ||
NetworkAddress, | ||
NetworkConnection, | ||
NetworkIO, | ||
Networks, | ||
NetworkStats, | ||
) | ||
|
||
FIXTURE_NETWORKS = Networks( | ||
connections=[ | ||
NetworkConnection( | ||
fd=1, | ||
family=2, | ||
type=3, | ||
laddr="laddr", | ||
raddr="raddr", | ||
status="status", | ||
pid=4, | ||
) | ||
], | ||
io=NetworkIO( | ||
bytes_sent=1, | ||
bytes_recv=2, | ||
packets_sent=3, | ||
packets_recv=4, | ||
errin=5, | ||
errout=6, | ||
dropin=7, | ||
dropout=8, | ||
), | ||
networks=[ | ||
Network( | ||
name="name", | ||
addresses=[ | ||
NetworkAddress( | ||
address="address", | ||
netmask="netmask", | ||
broadcast="broadcast", | ||
ptp="ptp", | ||
) | ||
], | ||
stats=NetworkStats( | ||
isup=True, | ||
duplex="duplex", | ||
speed=1, | ||
mtu=2, | ||
flags=[ | ||
"flag1", | ||
"flag2", | ||
], | ||
), | ||
) | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Fixture for processes module.""" | ||
from systembridgemodels.modules.processes import Process | ||
|
||
FIXTURE_PROCESSES = [ | ||
Process( | ||
id=1234, | ||
name="name", | ||
cpu_usage=12.3, | ||
created=12.3, | ||
memory_usage=12.3, | ||
path="/path", | ||
status="running", | ||
username="username", | ||
working_directory="/working/directory", | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
"""Fixture for sensors module.""" | ||
from systembridgemodels.modules.sensors import ( | ||
Sensors, | ||
SensorsNVIDIA, | ||
SensorsNVIDIAChipset, | ||
SensorsNVIDIADisplay, | ||
SensorsNVIDIADriver, | ||
SensorsNVIDIAGPU, | ||
SensorsWindows, | ||
SensorsWindowsHardware, | ||
SensorsWindowsSensor, | ||
) | ||
|
||
FIXTURE_SENSORS = Sensors( | ||
fans=None, | ||
temperatures=None, | ||
windows_sensors=SensorsWindows( | ||
hardware=[ | ||
SensorsWindowsHardware( | ||
id="id", | ||
name="name", | ||
type="type", | ||
subhardware=[ | ||
SensorsWindowsHardware( | ||
id="id", | ||
name="name", | ||
type="type", | ||
subhardware=[], | ||
sensors=[ | ||
SensorsWindowsSensor( | ||
id="id", | ||
name="name", | ||
type="type", | ||
value=12.3, | ||
) | ||
], | ||
) | ||
], | ||
sensors=[ | ||
SensorsWindowsSensor( | ||
id="id", | ||
name="name", | ||
type="type", | ||
value=12.3, | ||
) | ||
], | ||
) | ||
], | ||
nvidia=SensorsNVIDIA( | ||
chipset=SensorsNVIDIAChipset( | ||
id=1234, | ||
name="name", | ||
flags="flags", | ||
vendor_id=1234, | ||
vendor_name="Vendor Name", | ||
), | ||
displays=[ | ||
SensorsNVIDIADisplay( | ||
id=1234, | ||
name="name", | ||
active=True, | ||
available=True, | ||
connected=True, | ||
dynamic=True, | ||
aspect_horizontal=16, | ||
aspect_vertical=9, | ||
brightness_current=90, | ||
brightness_default=80, | ||
brightness_max=100, | ||
brightness_min=0, | ||
color_depth="Color Depth", | ||
connection_type="Connection Type", | ||
pixel_clock=60, | ||
refresh_rate=144, | ||
resolution_horizontal=1920, | ||
resolution_vertical=1080, | ||
) | ||
], | ||
driver=SensorsNVIDIADriver( | ||
branch_version="Branch Version", | ||
interface_version="Interface Version", | ||
version=1234, | ||
), | ||
gpus=[ | ||
SensorsNVIDIAGPU( | ||
id=1234, | ||
name="name", | ||
bios_oem_revision=1234, | ||
bios_revision=1234, | ||
bios_version="bios_version", | ||
current_fan_speed_level=1234, | ||
current_fan_speed_rpm=1234, | ||
driver_model=1234, | ||
memory_available=1234, | ||
memory_capacity=1234, | ||
memory_maker="Memory Maker", | ||
serial="abc123", | ||
system_type="System Type", | ||
type="Type", | ||
) | ||
], | ||
), | ||
), | ||
) |
Oops, something went wrong.