File: test_init.py

package info (click to toggle)
aiooui 0.1.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,300 kB
  • sloc: python: 119; javascript: 8; sh: 5; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest

from aiooui import async_load, get_vendor, is_loaded


@pytest.mark.asyncio
async def test_get_without_load():
    """Test getting a vendor without loading."""
    assert is_loaded() is False
    with pytest.raises(RuntimeError):
        get_vendor("00:00:00:00:00:00")


@pytest.mark.asyncio
async def test_get_vendor():
    """Test getting a vendor."""
    assert is_loaded() is False
    await async_load()
    assert is_loaded() is True
    await async_load()
    assert is_loaded() is True
    assert get_vendor("00:00:00:00:00:00") == "XEROX CORPORATION"