<filename>tests/test_category.py
from pytypecho import Category


def test_get_category(te):
    r = te.get_categories()
    assert r
    assert r[0]['categoryName'] == '默认分类'


def test_new_category(te):
    category = Category(name='Category Name')
    r = te.new_category(category)
    assert r
    assert isinstance(r, int)


def test_del_category(te):
    r = te.del_category(2)
    assert r

<filename>tests/test_category.py
from pytypecho import Category


def test_get_category(te):
    r = te.get_categories()
    assert r
    assert r[0]['categoryName'] == '默认分类'


def test_new_category(te):
    category = Category(name='Category Name')
    r = te.new_category(category)
    assert r
    assert isinstance(r, int)


def test_del_category(te):
    r = te.del_category(2)
    assert r
